The RunAction function runs a separate arbitrary Action from within the script. Essentially, this function allows one Action to call and process another Action.

aActionName is the name of the action that you wish to run - this parameter is not case-sensitive, although it will need to exactly match the Action name which includes spaces or any other characters that may be included in the name of the Action.

aAssignPartner is a boolean parameter which indicates that any current Trading Partner is only assigned if this parameter is True. Otherwise when this parameter is False, the specific action is run without a Trading Partner. This parameter can be a boolean variable.

Any Log information that results from an Action called with this function, is included in the Log of the originating Action

A script calling RunAction will complete even if the function fails - in which case the function will have returned False.

After a failure, any subsequent call to RunAction in the same script will return False immediately, without running the specified Action.

And after a failure in a script in an Action Step, no subsequent following Action Step will execute.

Declaration:   RunAction(aActionName: string, aAssignPartner: boolean): boolean;

In this example, there are two (2) Actions that are used - you will need to substitute your own Actions. Note that the 3rd run through makes use of an Action that is known to fail.

procedure ScriptEvent (var Value : variant);
var
  CanIt, WillIt, WontIt : boolean;
begin
//CanIt has a default value of False
LogInfo('');
LogInfo('=============== 1st run through ===================');
RunAction('Hello World', CanIt); // Run ignoring the result
LogInfo('');
LogInfo('=============== 2nd run through ===================');
WillIt := RunAction('HELLO WORLD', CanIt); //Trap the result
LogInfo('');
If WillIt = true then
LogInfo('Result returned TRUE.')
else
LogInfo('Result returned FALSE');
 
LogInfo('');
LogInfo('=============== 3rd run through ===================');
WontIt := RunAction('Type testing Cases', CanIt); //This will FAIL
If WontIt = true then
LogInfo('This one returned TRUE.')
else
LogInfo('This one returned FALSE');
 
LogInfo('');
LogInfo('------------------------------------------------');
LogInfo('');
LogInfo('YAY! This line should process as the finaline in the original action.');
 
end;

The Log that this code generates is shown below. Note that the script continues to process the last line/s. But the following step scheduled to run in this Action does not.  

image-20240201-004303.png