问题
I'm trying to link 2 documents ( Cdoc
and Pdoc
) based on the Cdoc UNID
.
I have a computed field ( computedfield3
) which is binded to a form'computed field having the default value @text(@documentuniqueid)
. The Pdoc
is inside a dialog which I show it using a button.
The button contains a Partial Update
for ID:computedField3
.
The button code:
if ( Cdoc.isNewNote() ) { Cdoc.save();
Cdoc.setValue("computedField3",Cdoc.getDocument().getUniversalID());
getComponent('exampleDialog').show() }
else
{
Cdoc.setValue("computedField3",Cdoc.getDocument().getUniversalID());
getComponent('exampleDialog').show()}
Then I pass the computedField3
value to Pdoc
using custom control properties.
I noticed if I opened an existing already saved Cdoc
, open it and add again a Pdoc
from the dialog, the existing UNID from the Cdoc
is changing... Is from the partial update?
How can I make it OK ?
Thanks for your time
回答1:
The key is not the save code. It's the dominoDocument datasource definition. Please see my latest comment here xpages save / cancel actions scenario
With ignoreRequestParams set to true and no documentId computed, you're always working on a new document.
来源:https://stackoverflow.com/questions/24407003/xpages-unid-of-documents-why-it-is-changing