I have a button on a view. The button calls 3 agents. Agent 1 unlocks a selected record by deleting the $KeepPrivate field. Agent 2 prints the doc, Agent 3 Sets the $KeepPrivate field to 1. An error message saying that the doc is private and can not be printed is dispalyed when using an R6 client. Agent 3 is setting the $KeepPrivate field back to 1 before Agent 2 has a chance to print the record. The code does work in R4 & R5, and has for the last 4 years. Below is the code.
Any ideas how to control the execution order of the agents in R6?
Thanks,
Andy
Button Code
@Command([ToolsRunMacro]; “(Print SPE WS)”);
@Command([ToolsRunMacro]; “(Print SPE WS2)”);
@Command([ToolsRunMacro]; “(Print SPE WS3)”);
@PostedCommand([EditDeselectAll])
Agent1 (Print SPE WS)
FIELD $KeepPrivate := @DeleteField;
Agent2 (Print SPE WS2)
@If(@Contains(Form; “Bonding”); @Command([FilePrint];“1”;“”;“”;“”;“”;“SPEWorkSheetB”;“pagebreak”;“resetpages”);
@If(@Contains(Form; “Production”); @Command([FilePrint];“1”;“”;“”;“”;“”;“SPEWorkSheetP”;“pagebreak”;“resetpages”);
@Prompt([Ok]; “SELECTION ERROR”; “You Must Select a Production or Bonding Record to Create a WorkSheet”)));
“”
Agent3 (Print SPE WS3)
FIELD $KeepPrivate := @If(@Contains(@ViewTitle; “Approve”); “1”; @DeleteField);