0

We are trying to save some additional information with a document using the QuerySaveDocument event. However it seems that it is not being triggered at all.

<xp:executeScript script="#{javascript:setField(document1, 'cCustAddr1_fi', 'test');}">
</xp:executeScript>

This is our basic script. All the setField() method does is use replaceItemValue to try and set the field. However it seems that QuerySaveDocument is not even being triggered since we can write pretty much anything and the document will still save without problem, even if it would be impossible to execute.

We have also tried using a simple document1.getDocument().replaceItemValue() script, but again I dont think it even attempts to execute. Our documents save perfectly fine too,

Do you see any reason for this, are we doing our saving wrong, or should we be attaching data onto the document in another way?

Thanks.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
  • Are you using the Unplugged Mobile Controls? If so I don't think the querySaveDocument event is going to work in that case and you'll need to take a look at the "saveDocument" function in unplugged.js and the UnpSaveDocument XPage. If you're not using these controls then Unplugged should support both the querySaveDocument and postSaveDocument events. – Martin Perrie Jun 20 '14 at 15:36
  • Asking for resources or tutorials is considered against the guidelines for StackOverflow. Could you re-phrase the question to include what you've tried? – Qix - MONICA WAS MISTREATED Jun 20 '14 at 16:07

1 Answers1

0

Your other question on Unplugged (Using other dialog controls in iOS) suggests that you are using the Unplugged Mobile Controls project.

If that is correct then my comment above applies - the querySaveDocument event won't get fired . You can look at the code in UnpSaveDocument.xsp and possibly add your own SSJS code to that.

Alternatively, if you want an additional item created on your back-end Notes document then you should just be able to add a hidden field to the UnpFormEditor that is bound to the document1 data source and using the relevant item name you want.

Community
  • 1
  • 1
Martin Perrie
  • 398
  • 5
  • 16