Field value not being saved

I Have a database that tracks potential business opportunities. Once the form is filled out, if someone puts it in edit mode to make any changes, there is a field that i try to copy to a hidden computed field using the PostmodeChange object of the form.

To do this i use the code:

_myValue := Stat;

@If(@IsNewDoc;“”;

@IsDocBeingEdited;@SetField(Tempfield;_myValue);“”);

The problem is once I save the form, “Tempfield” remains blank and doesnt store the value that i assigned to it in PostmodeChange.

What am I doing wrong here?

Any suggestions?

Subject: Field value not being saved

This might be a stupid question, but is the field name within the @setfield within quotes? Without the quotes, it won’t give you and error, but it won’t save the value to the field either.

@setfield(“tempfield”;_myValue)

Subject: RE: Field value not being saved

Not stupid at all - since you’re right

Subject: RE: Field value not being saved

Thanks guys…my face is suitably reddened(insert red faced icon here)

Subject: Field value not being saved

PostModeChange only triggers when going between read and edit mode, your changes are not getting saved (duh I know thats your issue) - How are you issuing the save?

Is there a saveoptions field on the form (or in the document)?

Subject: RE: Field value not being saved

Right, I only want the value to be copied to the hidden field when the user puts the document in edit mode. If the user then decides to change the value of that field i can run an agent that then notifies his group that the status of the document has been changed.

I cant do that if the value in the hidden field is not being saved.