Link to home
Start Free TrialLog in
Avatar of andyhines
andyhines

asked on

Problems composing a new doc based on an existing one after I save it

Hi, I have an application that uses a couple of forms. One to hold details of the drive and one to hold details of the fault with that drive. Users open up the drive form and hit a button to report a fault. This runs the following code which changes the status of the drive (to offline) and composes a fault form based on the current drive document. Problem is that intermittently the fault form is created based on the wrong drive.

@Command( [EditDocument]; "1" );
@If(DriveStatusMech != "Removed"; @SetField("DriveStatusMech";"Offline");"");
@If(DriveStatusFinal != "Removed"; @SetField("DriveStatusFinal";"Offline"); "");
@SetField("TesterStatus";"Offline");

@Command([FileSave]);
FIELD saveoptions:="0";
@Command( [EditDocument]; "0" );

@Command([Compose];"";"Fault Details")

It always seems to be the drive below the current one on the view that is used to generate the new form. My guess is that when the document gets saved it changes the order of the view temporarily and this affects the Compose command with inheritance of key fields. Has anyone seen this problem and can you offer me a solution.

Thanks, Andy

ASKER CERTIFIED SOLUTION
Avatar of marilyng
marilyng

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of SysExpert
SysExpert
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial