1
votes

I want to be able to send the UNID of the newly created document to the user, so that the user can access the document. In the execution script;

var unid = param.documentId;
var vUnid = newDocId.getDocument().getUniversalID;

Both were picking up the parent UNID, which already existed in the browser.

enter image description here

This image will show you how the document looks like and will be grateful to know how to pass the newly generated UNID when document is submitted.

2

2 Answers

2
votes

You need to add your code into the postSave event of your data source. The UNID for a new document only gets set when saved for the first time. Before that it's a temp value only

1
votes

Write your newly generated UniversalID into a sessionScope variable

sessionScope.newUnid = newDocId.getDocument().getUniversalID;

and use it in next XPage called after submit

var useTheNewUnid = sessionScope.newUnid;