This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Aug 17, 2012, 4:08 PM
5 Posts

Failure to read a just-udpated value from a view, from Data.postSaveDocument

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags: refresh save getDocumentByKey update
  • Replies: 0
(1)  I have an XPage with a single form for a data source, call the document F1. This XPage has a combobox to establish a relationship with another document of the same type (the UNID is stored), if desired; call this related document V1.
(2) My save button for F1s XPage (it is truly a save button) calls some server-side JS from a library; one of the things that this JS does is to set some values on F1s back-end document (to be used below).
 
This all seems to work correctly. 
Now, in addition to having a relationship with F1, V1 may have relationships with any number of other similar documents (F2, F3...F(n)).  
 
(3) I have additional server-side JS (again in a library) called from the F1s XPage Data.postSaveDocument event. The intention of this code is to force V1 to evaluate something based on all of its related F1, F2...F(n)).

(4) So in this postSaveDocument I return a collection of F(n) (including F1) and do my evaluation and update V1. The problem is F1 does not appear to be the latest saved version, so it doesn't have the value I updated in (2).
 
I have added a view refresh before getting the collection in (4), but still no luck. 
 
So, is there a requirement to have closed the XPage before the backside refresh really happens? Or, is there some quirk that requires me not to call a function in a library to accomplish (2)?
 
Thank you; any insight into this or general timing of events would be much appreciated. 
 
EDITED - As far as I can tell so far, this may only be an issue when F1 is new and first being saved. 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal