We are updating the xml in a dynamic data service with this piece of code:
Txn ntx = new TxnQuery() .setId(txn.id) .withFormXml() .firstValue() XmlDoc xmlDoc = new XmlDoc(ntx.formXml);
TxnUpdater txUpdater = new TxnUpdater(ntx);
After submitting the form, we request another page of another form by the job service but we don't see the changes in the mapped form fields.
How can we retrieve the updated xml in the form?
Do we need to call a function in the form to synchronize the updated xml from TM?
Thanks in advance.
firstly, if you push a password field value into the XML (form view) it will become "visible" on the client side, consider security here. Even hidden Data field values can be seen via web browser developers tools.
Secondly, I wouldnt recommend updating the XML payload stored on the server via a Dynamic data service (DDS) as the "source of truth" is the XML loaded in the web browser while the form is open.
If its ok to keep the password in the XML on the client side, return it as a result of the DDS service call and populate into a data field bound to "/AvokaSmartForm/Ejecutivo/Password". When the user saves/submits the current form the DDS was called from, the password value in the XML payload will get stored on the server. Note, that if the user wont save/submit the form the password value would be lost. (this contradicts with my previous statement however you can still do both: 1. store in the XML on the server as you already do + 2. return back and populate in the form from the DDS result).
Preferably, if the password value is not to be "shown" on the client side, store it as a submission property in the DDS service and fetch it later on as needed (prefill into a new BOH form/task XML, populate into the XML before submission delivery, etc..)
Lastly, the new TM 17.10 introduces a great new feature - Transact Functions (doco coming soon) - which I believe will support your use case nicely > the updated XML in your DDS can be pushed back to the UI form so all fields can be re-populated.
hope this help
Hi Miro , do you have an example of the Transact Functions you mentioned ? It seems to be just what we need
Hi Jorge, unfortunately I dont have any yet. The TM 17.10 which has this feature has just been released. Avoka product & knowledge teams are completing the doco for this atm. In order to use Transact Functions you will need to upgrade the TM server and your Maestro forms/projects to 17.10.