Can any body let me know how can i get foremthreadid of a forumreply,
$core_v2_forumReply.Get(934885).ParentId
when running above code getting blank , then my question is how we can get forumthreaadid of a forumreply
Can any body let me know how can i get foremthreadid of a forumreply,
$core_v2_forumReply.Get(934885).ParentId
when running above code getting blank , then my question is how we can get forumthreaadid of a forumreply
Does this work?
#set($reply = $core_v2_forumReply.Get(934885))
$reply.ParentId
no in that i am getting nothing mean same $reply.ParentId is printing
That means its null, velocity scripts do not have a concept of null so it just prints the statement.
or the reply is null, either one will have the same result
so in that case how we can get forumthreadid for a forumreply
$reply.ThreadId
But you need to ensure your $reply is not null and you're making the correct call to get it back
But you need to ensure your $reply is not null and you're making the correct call to get it back
#set($reply = $core_v2_forumReply.Get(934885))
$reply.ThreadId
when i am running this code i am getting 934885(same id)
in that case how it may be forumthread id because it is forumthreadreply id
While unlikely, Ids are not globally unique so it is possible. Have you actually checked these Ids?
i am getting same $core_v2_forumThread.Get(934885) print
Please try this in the script console to figure out if your reply is null.
#set($reply = false) #set($reply = $core_v2_forumReply.Get(934885)) #if ($reply) Reply's Thread ID: $reply.ThreadId #else Reply does not exist. #end
Assuming your reply ID is correct and the reply exists, then your original syntax approach would have still worked, though with ThreadId instead of ParentId. That said, it's better to have those kinds of null checks for safety anyway.
$core_v2_forumReply.Get(934885).ThreadId