FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.



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 :)

R.

Oct 25, 2017, 2:09 PM
9 Posts
Fixed.

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


FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.