Template Variables for Actions and Components

Template Variables for Actions and Components

From LongJump Support Wiki

Template Variables for Actions and Components
Jump to: navigation, search

Contents

About the Template Variable Tool

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

Template Variable Selector

File:notepad.png

Note: In some contexts, variable names uses braces - { }. In other cases, they don't. The Template Variable Tool lets you quickly determine the format used in your current context.

Learn more: Template Variables

About Template Variables

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
A variable containing the identifier of the object
selectedRecords
An array containing one element - the identifier of the selected record
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
    Each category contains a number of fields. The list of categories depends on your context.
  2. Choose a field from the Category.
    Fields
    Contains the available fields from the selected category.
    The Variable Field is populated with the syntax for your choice
  3. Copy the string and paste it into your work
    Variable field
    {$account.name}

File:notepad.png

Note: When specifying a field, you use it's internal Field Name. Not the 'Field Label that appears in the GUI.

Template Variables for Component Actions

The following template variables are available for use in Actions in Components. 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--
$ObjectID{$object_id}YesYesYesYes
$GROUP_ACTION{$GROUP_ACTION.ids}YesYesYesYes
$CUSTOM_CONTROL{$CUSTOM_CONTROL.[ComponentName]}YesYesYesYes
User
{$user.today}YesYesYesYes
{$user.full_name}YesYesYesYes
{$user.first_name}YesYesYesYes
{$user.last_name}YesYesYesYes
{$user.email}YesYesYesYes
{$user.phone}YesYesYesYes
{$user.city}YesYesYesYes
{$user.state}YesYesYesYes
{$user.zip}YesYesYesYes
{$user.country}YesYesYesYes
{$user.title}YesYesYesYes
{$user.division}YesYesYesYes
{$user.fax}YesYesYesYes
{$user.mobile}YesYesYesYes
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}YesYesYesYes
User
{$user.today}YesYesYesYes
{$user.full_name}YesYesYesYes
{$user.first_name}YesYesYesYes
{$user.last_name}YesYesYesYes
{$user.email}YesYesYesYes
{$user.phone}YesYesYesYes
{$user.city}YesYesYesYes
{$user.state}YesYesYesYes
{$user.zip}YesYesYesYes
{$user.country}YesYesYesYes
{$user.title}YesYesYesYes
{$user.division}YesYesYesYes
{$user.fax}YesYesYesYes
{$user.mobile}YesYesYesYes
Personal tools