Salesforce

How Do I Set the Function`s Parameters? (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

How Do I Set the Function’s Parameters? (Magic xpa 3.x)

The parameters for a function work just like the parameters for a task or event handler. They are variables, with a type of Parameter.

To create parameters for a function, you just create as many Parameter-type variables as you need, in the order you want them. Once you create them, they will show up on the Functions List represented by letters, to make them easy to use.

Note that the parameters used by a function are strictly input parameters. Because functions are used in expressions, the data is always sent by reference and cannot be changed by the function. If you want to pass any information back, you need to use the Returns: field (see How Do I Set the Return Value of a Function?).

Hint: If you forget to set the variables to type Parameter, then they will still work, but will not show up on the Functions List. If you have functions which parameters don’t show up, this is most likely the reason.

Creating parameters for a function

  1. Go to your Function logic unit.

  2. Press F4 (Edit->Create line). A blank line will appear below your cursor position, and your cursor will be located on a field at the left side of the new line.

  3. Type V. The word “Variable” will appear and your cursor will move to the right.

  4. Type P. The word “Parameter” will appear and your cursor will move to the right.

  5. Type in the name of your parameter, then tab to the right.

  6. Select the model for this field, or set the data type and other properties manually.

  7. Repeat for as many parameters as you need.

Now your function can accept parameters. When your function shows up on the Functions List, you will see letters representing the data type of each of the parameters, as shown above.

See also

The Online and Rich Client Samples projects (program LG02 and RLG02)

Reference
Attachment 
Attachment