Set a flag with a button

Hi again, lots of questions today. =)

I want to use a button to set a flag/field in a document. The problem is that the users that will use the button will sometimes be in edit mode, and sometimes read mode. I’ve asked about this before and got a lotus/javascript answer but unfortunately I only know how to use @-commands and functions. My button is coded as follows:

@Command( [EditDocument]; “1” );

FIELD Flagga := “1”;

@Command([FileSave])

The document is changed to Edit mode, the field is set to “1” and the document is saved. But when the user closes the document he/she still is prompted if he/she wants to save the document. Regardless what the user chooses the field “Flagga” is already set to “1”, why does this last prompt appear when the document is already saved?

Thanks in advance

Frank

Subject: Set a flag with a button

The execution order is what is causing your problem.

Try putting the commands in a @do loop, or use @postedcommand instead of @command. Also, try using @setfield instead of FIELD.

Subject: Set a flag with a button

Frank,

Look into using the SaveOptions field.

Set SaveOptions to “0” after your FileSave. This will stop the save continuing (I am assuming the user will not be making any further changes to the document after pressing the button - if so, these will be lost)

Mike