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, 3:17 AM
21 Posts

Inherit field value

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: inherit
  • Replies: 3
 
I have a document which I want to archive and a the same time create a new document which inherit some of the field values in the archive document.
 
What I need to do is to click a button in the document which will open a new form which inherit some of the field values . The form is not a response form.
 
Is this possible? 
Aug 17, 2012, 3:28 AM
366 Posts
Re: Inherit field value
 The easiest way to do this is set the "parent" forms values in session scope variables and then write those session scope values to the controls in the new document.
 
There is not "inheritance" in XPages. 
 
 
Aug 29, 2012, 9:11 AM
93 Posts
Re: Inherit field value
 I have done exactly this in the way Paul describes with sessionScope variables and it works well.
 
Another alternative is to call a function, passing in the values you want, and this function creates the document and sets the values on the document based on the values you passed in. 
 
Also, like with sessionScope variable, you could use a requestScope variable which is a little more efficient for what you are trying to do....
 

"The requestScope variables last for the duration of the request. This means the variables will last for the duration of a url request from the server. The variable can exist across XPages i.e. if an XPage is requested from another XPage. The requestScope variables are useful for variables which can be deleted straight after the value is submitted to the server. This means that there is not extra memory being used to store variables that are no longer needed."
Oct 17, 2012, 1:20 AM
21 Posts
Re: Inherit field value
Thanks all...
 
I get this done using copyAllItems

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