I am using @Dialogbox to update some values in a parent document, but I need to have the parent doc execute its QuerySave event. The @Dialogbox approach updates specific fields in the parent doc, but I can’t get any of the form events of the parent doc to trigger. Any ideas how to do this?
Subject: How to force parent QuerySave from @Dialogbox?
Use @Command([FileSave]) after the dialogbox. Or use @Command([RefreshWindow]) right after the @DialogBox command, and copy your querySave code to PostRecalc.
Subject: RE: How to force parent QuerySave from @Dialogbox?
I have tried several variations, including this one:
@Do(@Command( [EditDocument]; “1” );
@DialogBox(“UpdateAccess”; [SizeToTable] );
@Command( [RefreshWindow] );
@Command( [FileSave] );
@Command( [CloseWindow] ))
With and without the various @Commands, I haven’t found anything that reliably and cleanly triggers a save event (or even a postrecalc event) in the parent doc when closing a @DialogBox. For example, when I include @Command( [FileSave] ), then I get the Messagebox “Someone else modified this document at the same time”, and the parent doc save event is cancelled.
It seems that this should be easier than it is - what am I missing here?
Thanks in advance,
Karl Forsyth
Subject: RE: How to force parent QuerySave from @Dialogbox?
If “someone else” modified it, then you probably have some code within the dialogbox form or events which causes a back-end save. Not a good idea.
QuerySave’s are pretty clear-cut, if the doc is allowed to be saved in the UI, the QuerySave will be executed. That’s one of those things Notes doesn’t get wrong. A back-end save is different. It just saves the doc, period. If a back-end save is disallowing the front-end save, then it’s not really the QuerySave that’s failing, it’s the (front-end) Save itself.
Also, if the @DialogBox, is source of an error, your set of formula statements is probably stops at that statement, preventing the other @Commands from executing. That’s why you might not be seeing PostRecalc results either.