1

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.

Pramod Gharu
  • 1,105
  • 3
  • 9
  • 18

2 Answers2

2

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

stwissel
  • 20,110
  • 6
  • 54
  • 101
1

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;
Knut Herrmann
  • 30,880
  • 4
  • 31
  • 67