Extra 'Do you want to save?' message

I fought with this a while back and got my ‘Save and Exit’ button to NOT give me the extra “Do you want to Save?” message. But now I want to add in one @SetField before I save & exit and I’m getting it again. I’m frustrated. Any ideas?

@SetField(“Status”;“Pending”);

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

Subject: Extra ‘Do you want to save?’ message

The problem is that the FileCloseWindow command is one of the commands that is always executed last, no matter where you put it in the code.

You could use @postedcommand here; those are executed in the order they are stated (although they will execute after all other formulas, but that does not matter in this case). So:

@SetField(“Status”;“Pending”);

@If(@PostedCommand([FileSave]);@PostedCommand([FileCloseWindow]);“”)