Agent Execution Order not working in R6

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);

Subject: Agent Execution Order not working in R6

Hi Andy,

try the new R6 command for running agents, which are meant to execute immediately - don’t understand why the old way doesn’t execute in the correct order, though.

@Command( [RunAgent] ; “agentname”)

hth

Tony