I’m trying to trigger some code in the XPages querySaveDocument event (ideally I want to do something along the lines of continue=false in Notes Client QuerySave event).
I am being hampered somewhat by the lack of documentation in the Help and on the web about how to use these events. I am adding a simple ‘if’ statement, as below:
if (ansDoc.getItemValueString(“AFormat”) == “Radio”) {
}
Within the if statement I will the do my code. However, I keep getting the following error returned:
"Error while saving data sources
Error saving data source ansDoc"
ansDoc definitely has a text field called AFormat, and even if it did not, I would expect a different error message to be returned. I tried ansDoc.getDocument().getItemValueString(“AFormat”) and tried adding an if statement to ensure ansDoc.getItemValueString(“AFormat”) is not null. I’ve also tried:
if (ansDoc.getItemValueString(“AFormat”) == “Radio”) {
return false;
} else {
return true;
}
I still get the same error. Is there something wrong with my code I’m missing? Is there a bug with the querySaveDocument event? Am I trying to do something with the querySaveDocument event which is not possible?
If anyone has examples of how they have used the querySaveDocument event to do something like this, I would be very grateful.
Thanks
Paul