Reputation: 153
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.
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.
Upvotes: 1
Views: 189
Reputation: 30960
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;
Upvotes: 1
Reputation: 20384
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
Upvotes: 2