Difference between revisions of "Template Variables for Actions and Components"

From LongJump Support Wiki
imported>Aeric
imported>Aeric
Line 4: Line 4:
:''Learn more:'' [[Template Variables]]
:''Learn more:'' [[Template Variables]]


[[File:Templatevariablesinactions.gif|right|Template Variable Selector]]
[[File:Templatevariablesinactions.gif|center|Template Variable Selector]]


[[AJAX and REST]] can be used to communicate with the platform, by writing JavaScript in an Action. The following implicit variables are available in the JavaScript:
[[AJAX and REST]] can be used to communicate with the platform, by writing JavaScript in an Action. The following implicit variables are available in the JavaScript:

Revision as of 00:01, 18 June 2011

Use the Template Variable tool shown below to insert variables for:

Learn more: Template Variables
Template Variable Selector

AJAX and REST can be used to communicate with the platform, by writing JavaScript in an Action. The following implicit variables are available in the JavaScript:

object_id
Variable containing the identifier of the selected record
selectedRecords
Array containing the identifiers of the selected records:
  • For Single Action: Array containing one element with the identifier of the selected record
  • For Group Action: Array containing multiple elements with the identifiers of the selected records
Examples
Identifier of the object that the user selected:
alert("You have selected object : " + object_id);
Dialog that shows the identifier of the first selected record:
alert("You have selected Record : " + selectedRecords[0];

Lookup a Template Variable

  1. Choose a Category
    Category
    Can contain any of the following:
    • Objects
    • $ObjectID
    • $GROUP_ACTION
    • $CUSTOM_CONTROL
    • Fields related to Users
  2. Choose a field from the Category
    Fields
    Contains the available fields from the selected category
  3. In the Variable Field, find the correct syntax for the template variable
    Copy the string and paste it into your work (as part of an Email / Print / Workflow HTML template, as Email Subject or in the Body of the message, or in an Action
    Variable field
    {$account.name}
Note: The Field Name is not same as the Field Label

Template Variables for Actions in Components

Template Variables for Actions in Components

Template Variables for Actions Using Execute JavaScript

The following JavaScript template variables are available for use in Actions using the Execute JavaScript option. Some template variables are not evaluated when the action is executed. In the following table:

  • "Yes" indicates that the template variable is evaluated when the action is executed
  • "--" indicates that the template variable is not evaluated when the action is executed.
A warning message is displayed when a template variable is included that is of the not evaluated type.
Category Template Variable Single Record Group Action Both

Single Record

Both

Group Action

Object {$fieldname} Yes -- Yes --
$AppSessionID {$AppSessionID} Yes Yes Yes Yes
User
{$user.today} Yes Yes Yes Yes
{$user.full_name} Yes Yes Yes Yes
{$user.first_name} Yes Yes Yes Yes
{$user.last_name} Yes Yes Yes Yes
{$user.email} Yes Yes Yes Yes
{$user.phone} Yes Yes Yes Yes
{$user.city} Yes Yes Yes Yes
{$user.state} Yes Yes Yes Yes
{$user.zip} Yes Yes Yes Yes
{$user.country} Yes Yes Yes Yes
{$user.title} Yes Yes Yes Yes
{$user.division} Yes Yes Yes Yes
{$user.fax} Yes Yes Yes Yes
{$user.mobile} Yes Yes Yes Yes