Task - Call function

Declaration

<AMTASK ACTIVITY="call_function" FUNCTIONNAME="text" RESULTVARIABLE="text" />

Related Topics   

Description

Calls a function defined in the task. If the function returns a result, you can specify the name of the variable in which to place the value. For more details, see Task Functions.

NOTE: Using a percentage character (%) to delimit variables is optional, however, all string literals (strings to be taken as themselves) must be surrounded by double quotes (for example, "string literal").

Practical Usage

Used to pass control to a subroutine; after the subroutine is executed, control returns to the next instruction in main task.

Parameters

General

Property Type Required Default Markup Description
Function name to call Text Yes (Empty) FUNCTIONNAME="thefunction" The name of the function to call. To create a task function, see Task Function.
Return result into variable Text No (Empty) RESULTVARIABLE="theVar" The name of an existing variable to populate with the results of the call function.

Description

Error Causes

On Error

Example

NOTE:
  • The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
  • Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.

Description

This sample task calls the function theFunctionName and populates the theVariableName with the results.

Copy
<AMTASK ACTIVITY="call_function" FUNCTIONNAME="theFunctionName" RESULTVARIABLE="theVariableName" />