@Command execution order problem

Hi,

I create a new empty form with only a button containing the following formula, using the new v6 command functions that are supposed to execute immediately:

SetField(“Foo”;“Somevalue”)

@Command([FileSave]);

@Command([RunAgent]; “(SomeAgent)”);

@Command([CloseWindow])

“SomeAgent” does not contain any code, with target “None”.

Now, when I push the button on a new document, I get the “Do you want to save your changes?” message.

And at the moment when the agent is run, the document has not been saved yet.

Wrapping the commands in a @Do or checking the return of the save (with an @If) before continuing does not change anything.

Could anyone please explain this?

Thanks all.

Subject: @Command execution order problem

try this instead:

SetField(“Foo”;“Somevalue”)

@PostedCommand([FileSave]);

@PostedCommand([RunAgent]; “(SomeAgent)”);

@PostedCommand([CloseWindow])