Oct 25, 2017, 11:51 AM
9 Posts
topic has been resolvedResolved

Weird behavior

  • Category: Server Side JavaScript
  • Platform: Other
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 1

Hello everyone,

I'm having this weird behavior and I'm not sure if it's me not misunderstanding variables or it's an xpage bug.

I have a document with a field called "hours" and it has a value of 8.

Here is my simplified code . 

var xHrs = doc.getItemValueDouble('hours');
println (xHrs);  // at this point, hours is 8
doc.replaceItemValue('hours', 0);
return xHrs;  // returns 0;


Why is xHrs back to 0 when I replace the document value to 0?  How do I break the link?


Thanks in advance for the help :)


Oct 25, 2017, 2:09 PM
9 Posts

Somewhere lost in the code, the function was being called twice.