Subject: Still can’t figure out @PostedCommand & @Command
@postedcommands will always execute at last even if they are written in middle of set of formulas. @commands will execute in the order without waiting for other commands to finish.
So, in the first example “NeedValidate” is set to “0” first and then the save and close commands executes.
In second example, after setting the field value, both the save and close happens at same time and as the doc is updated but not save prompts for save dialog.
Subject: RE: Still can’t figure out @PostedCommand & @Command
Thanks phani again,
Just wanna make sure is that meant the two statements using @Command will execute at the same time while @PostedCommand will execute in order (at last after other formulas).
It seems to me that @Command are not execute in order (save and then fileclose) but at the same time after other commands, thus causing my doc not saved at the time of fileclose thus prompting dialog box.
If that is true, it will always be problem of using:
@Command([FileSave]);
@Command([FileCloseWindow])
since they are run at the same time and will always prompt user a dialog box.
But it is very strange that I have tested another scenario, I add another field ABC with default value “1”:
And .Click for the button:-
@SetField(“ABC”;“1”);
@Command([FileSave]);
@Command([FileCloseWindow])
On clicking the button, it simply save and close the window.
If I change the first line to:
@SetField(“ABC”;“0”);
On clicking the button, it prompt a dialog box for saving.
If I click the Cancel in the dialog box, then it returns to my doc and again I click the Save button, it could simply save&close the window without prompting dialog box.
What is happening???
But using @PostedCommand, click the button becomes normal as no dialog box will be prompted.