Right Click Edit does not fire code in Postmodechange

In one of my forms I have the follwing formula in the PostModeChange event:

des := @Right(PartDesc;@Length(PartDesc) - 10);

@If(Status = “Approved” & ArchiveFlag = 0; “”; @Return(“”));

@If(PartStatus = “Inactive” ; @SetField(“PartStatus”;“Active”) : @SetField(“PartDesc”;des) ; “”);

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

@SetField(“PDLSend”; “”);

@SetField(“PurchSend”; “”);

@SetField(“DisplayStatus”; “Modified”);

Now when a form is in the Approved state it will change to the Modified state if it has not been archvived. This works great if you do a double click to open the form or if you use the Edit button with the @command([EditDocument];1). However, yesterday it started not working if a user does a simple right click on the document and selects Edit.

Does anyone know how to fix this?

Thank in Advance,

Teri

Subject: Right Click Edit does not fire code in Postmodechange

Opening a document from a view directly into Edit mode (Ctrl-E does this as well) is not considered a mode change.

You will need some code in PostOpen to detect and handle this situation.

Subject: RE: Right Click Edit does not fire code in Postmodechange

Thanks Graham, I put code in the PostOpen as suggested and now have it working.

Teri