0
votes

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
First thing that comes to mind is, you might be overwriting cdoc somewhere - please create a simple whole example with the problem so we can help you better. Also please note that UniversalId is a read/write property, so make sure you are not changing it somewhere in your code by mistake.pipalia

1 Answers

2
votes

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.