May 26, 2016, 12:30 AM
1 Posts

Set value to a new document in xpages

  • Category: Other
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: xpages,queryNewDocument
  • Replies: 2

Hi! I need to set the authors department and post when creating new document and show it immediatly on page.

I am new to Xpages, that is why I need your help.

May 26, 2016, 4:30 PM
453 Posts
Where are you going to get the Users Department from??

I'm assuming that it will be the NAB in which case I would put some code in the BeforePageOpen event to look up the user in the NAB and get their Department from the person document, assuming it is entered there. Then populate a field with that value.

May 28, 2016, 10:39 AM
589 Posts

It's a little difficult to advice without more info or some starter code...  Bill is on the right track though.  There's the beforePageOpen event for things like this.  Also if you're binding to an actual notes document there's some events there as well for "postOpen" of the document I think.  That would be a good candidate to add code to 1st find the users department and then write it to a document field.