Strange @Command([FileSave]) & @Command([FieCloseWindow])

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?

Subject: Strange @Command([FileSave]) & @Command([FieCloseWindow])

Try FIELD ABC := “xxx”;

@If( @Command([FileSave]); @Command([FileCloseWindow]); @Return(“”) )

Not sure why, using @SetField command acts weirdly for different scenarios.

Subject: RE: Strange @Command([FileSave]) & @Command([FieCloseWindow])

I just had a problem with the same Commands not closing on a newly created document. It’s created using Lotusscript on a workflow process. I ended up changing the Save button to a Lotusscript function to fix it. Try setting the field in LotusScript.

EG

Sub Click(Source As Button)

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUiDocument

Set uidoc = workspace.CurrentDocument

Call uiddoc.FieldSetText(“fieldname” , “Value”)

Call uidoc.Save

Sleep(1)

Call uidoc.Close

End Sub

Note:The Sleep command was to allow document locking to occur. You most likely wouldn’t need it unless you have it enabled.