This post had been posted before but did not get response, so I change the subject for my question.
I got confusion in using:
@Command([FileSave]);
@Command([FileCloseWindow])
and
@PostedCommand([FileSave]);
@PostedCommand([FileCloseWindow])
I know that from help and other’s answers, which state that @Command execute in order while @PostedCommand execute at last after other commands.
But it seems to me that SOMETIMES @Command statements are not execute in order (filesave+fileclosewindow) but at the same time after other commands, thus causing my doc not saved at the time of executing fileclosewindow thus prompting dialog box asking for saving or not.
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 without prompting dialog box.
But if I change the first line to:
@SetField(“ABC”;“0”);
On clicking the button, it prompts a dialog box for saving.
If I click the Cancel in the dialog box, then it returns to my doc and this time when I click the Save button again, 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 no matter what the ABC value is.
It really confuse me so much, can I seek for your help?