Forced Update

Hello All - I need to do an lookup on the document refresh and/or save So even if the formula @Command([ToolsRefreshAllDocs]) is used, the lookup takes place and is saved within the document.

Where is the best event to place the code so that the dats is updated?

Agent Code:

FIELD SerialNum:=SerialNum;

FIELD AssetCenter:=AssetCenter;

MachineRes:=@DbLookup(“”:“NoCache”;“”; “ACF”;ID;2);

x:=@If(@Contains(MachineRes;SerialNum);“YES”;“NO”);

@SetField(“AssetCenter”;x);

Subject: Forced Update

Create MachineRes and AssetCenter as computed fields on the form and dump the agent. And they will evaluate when docs are refreshed/saved.

Also, you arent trapping @Dblookup /spank, if theres an error the form wont refresh.

MachineRes field formula:

LKUP:= @DbLookup(“”:“NoCache”;“”; “ACF”;ID;2);

@If(@IsError(LKUP) ; @Text(LKUP) ; LKUP);

AssetCenter field formula:

@If(@Contains(MachineRes;SerialNum);“YES”;“NO”);