SwitchForm and Save

Hey people!

I have an action on a form. The action runs the code below which works fine to open my Doc in another for for editing.

@Command([SwitchForm]; “frmEditForecast”);

@If(@IsDocBeingEdited; @True;@Command( [EditDocument] ; 1 ))

Then in the edit form I have a button that performs the following code.

REM {Save user level changes to document};

@Command([FileSave]);

REM {Move back to the sales form};

@Command([SwitchForm]; “frmSalesForecast”)

When I run the code above the form does not revert back because I save then revert and then the window gets closed.

If I reverse the order I get a save prompt when trying to change the forms because I have edited the field contents.

Does anyone have any thoughts on the way to save and revert the forms?

Cheers,

Shawn

Subject: SwitchForm and Save

You could have a computed field within form “frmEditForecast” as follows:Name - Form

Value - frmSalesForecast

Beware, if you have any frmEditForecast documents in your database, they will automatically change to frmSalesForecast if they are edited.

Subject: RE: SwitchForm and Save

Charlie,

Bang on the money. Thanks for hte help.

Shawn