Jan 2, 2012, 6:01 AM
150 Posts
topic has been resolvedResolved

$REF is ok, but response count in SSJS and LS is zero

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 3
 
Hello 
I am trying to create responses to main documents in xPages, I have tried both setting it in code using doc.makeResponse(parent) and by setting the parent id on the new response data source.
 
everything seem to work , the responses get the $REF field and it points to the correct parent doc and when I open the response in the notes client and from the menu use "View-Parent Preview" the parent documents show up fine.
 
but when I try to use document.getResponses().getCount() in SSJS or document.responses.count in Lotusscript it always say 0  (zero)
 
 
any ideas?
 
Thomas 
 
 
 
 
Jan 2, 2012, 8:45 AM
261 Posts
Re: $REF is ok, but response count in SSJS and LS is zero
Hello Thomas,
 
Strange. I haven't had any problems using the .getReponses() method.
 
Does the web user have access to the response documents?
 
Mark
Jan 2, 2012, 11:25 AM
150 Posts
Re: $REF is ok, but response count in SSJS and LS is zero
 
Well, it is working in "normal use"
 
I have two similar scenarios where it does not work, I need to do some more investigation before I can tell if it is a bug or not.
 
I have with several other scenariois have problem where getCount or getResoonses does not work when running locally.
 
 
stay tuned
Thomas 
Jan 2, 2012, 11:47 AM
150 Posts
Re: $REF is ok, but response count in SSJS and LS is zero - SOLVED
Stupid me, I had enabled the db option: "don't support specialized response hierarchy"
 
Lessons learned: if you use "don't support specialized response hierarchy" then getCount and getResponses will not work in LS and SSJS
 
Case solved 
Thomas