Responding to cross-dictionary triggers

When a cross-dictionary trigger is activated, a trigger processing procedure in your dictionary is run. Because the processing procedure is running in a different dictionary, responding to a cross-dictionary trigger isn’t as easy as a standard trigger. In your trigger processing procedure, you may have to use the execute() function to execute sanScript code in the dictionary in which the trigger occurred. You will use this “pass-through” sanScript code to get or set values in the dictionary in which the trigger occurred.

Using the execute() function

To set and retrieve values with the execute() function, you must use its parameter passing capability. For example, to retrieve the value of the FFirst Name field in the dictionary whose product ID is 414, you could use the following sanScript code in the trigger processing procedure.

local text code;
local string compile_message;
local integer error_count;
local string field_val;

{Build the sanScript code to execute.}
code = "inout string ret_val.";
code = code + "if isopen(form HR_Applicant) then ";
code = code + "ret_val = 'FFirst Name' of window HR_Applicant_Tracking of form HR_Applicant.";
code = code + "end if.";

{Execute the code.}
error_count = execute(414, code, compile_message, ret_val);
if error_count <> 0 then
	{Errors in the pass-through sanScript.}
	error "Error in pass-through sanScript code.";
end if;

Documentation Feedback