data is not coming for furum reply

Hi Immediate after the forum reply when i am getting the list of forumreply my newly reply is not coming in returned list, but after 1 min it is coming what should I do as I am using 

#set($pagedListResponse = $core_v2_forumReply.List($threadId)) API

Parents Reply
  • Here is my basic test I ran in the script sandbox in widget studio:

    #set ($forumthreadid = 7)
    #set ($body = 'Test #5')
    #set($forumReplyResponse = $core_v2_forumReply.Create($forumthreadid, $body))
    #if ($forumReplyResponse.HasErrors())
        <div>Reply create has errors</div>
    #end
    #set($pagedListResponse = $core_v2_forumReply.List($forumthreadid))
    <ul>
    #foreach($post in $pagedListResponse)
        <li>$post.Id: $post.Body()</li>    
    #end
    </ul>

    Note that '7' is an existing thread that I'm using for testing and that I incremented the # in the body for each test. The result I see is that the reply is always returned (within default page size limits) in the immediate forum reply list response.

    Are you seeing a different result with this test script (correcting it to use a valid thread ID)?

Children
  •    I tried your suggested approach by below code but still not getting appropriate list.

    #set ($forumthreadid = 352213)
    #set ($body = 'Test #5')
    #set($forumReplyResponse = $core_v2_forumReply.Create($forumthreadid, $body))
    #if ($forumReplyResponse.HasErrors())
    <div>Reply create has errors</div>
    #end
    #set($pagedListResponse = $core_v2_forumReply.List($forumthreadid))
    <ul>
    #foreach($post in $pagedListResponse)
    <li>$post.Id: $post.Body()</li>
    #end
    </ul>

    I put this code on content page of widget and I refreshed the page multiple time every time I  was getting below result.

    • 939363:

      fine and testing

    • 939364:

      second

    • 939365: Test #5

    But after 1 min I was getting all reply created by page load (shown below)

    • 939363:

      fine and testing

    • 939364:

      second

    • 939365: Test #5
    • 939366: Test #5
    • 939367: Test #5

    NOTE: as I observed all reply created into same time stamp was not visible immediately, when time stamp change by 1 min all reply came into list.

  • Does the example work within the script sandbox in Widget Studio? If so, do you have any server-side or CDN caching (not part of Community) enabled on your community site?