Context Objects

Using Context Objects allows to set dynamic context on the Form. Merge Fields from Context Objects can be used everywhere on the Form: as Default Value, Title, Condition and any other input on the Form Item.
The Context Objects and Merge Fields are available on the right side panel.

Select the Context Object Type (1), select required Field (2), Copy the Merge Field value (3) to put it in any place in the form (4).

 

The form supports 2 kinds of Context Object Merge Fields:

Static

Merge field values are calculated upon Form load and changes are not reflected till the Form is refreshed or the Update Records Action is called. More details at Update Records Action

E.g., these fields refer to Data Source Object record fields - they will remain unchanged in the memory until updated on the server and form refreshed:

Section title (5) will be calculated on form load and even the value of the Account Name is changed, Title won't be changed.

Dynamic

Merge Field values are calculated dynamically on-the-fly. If their sources are changed, these fields will become updated without receiving data from server. 

E.g., these fields (6) are based on Form fields (as Object, as virtual): 

If you use {$Form.inputstring}, this will insert the value, which is currently contained in the virtual field named "inputstring" on the Form. 

Also, if you use {$Form.AccountNumber}, this will insert the value currently contained in the Object field named "AccountNumber" on the form.

So, the difference:

  • {$Account.AccountNumber} will give you value of the field of the record you're currently working with. This value is taken from the server when form is loaded, and will not change even you edit this field on the form. This merge field looks at the source data, that has been taken on form load.
  • {$Form.AccountNumber} will give value of the field you're currently see on the from - even if it has been edited and not saved. This means system will take CURRENT value of text input.  This merge field looks at place, where copy of source data has been placed to be edited.

 

The form Context Object Types are:

Form Source Object

Allows to use merge fields from the form Source Object. 

You can also use related object fields but before using you should add them to the Tools - > Fields. See more details at Additional Fields.

Note: the form Source Object context object is a static type and even you change the field value on the form, the old values will be used. To use dynamically changed values use $Form context object. Keep in mind that such option is available only when it is an option at the current menu.

System

Allows to use System data such as: Date/Time, Session ID, Force Base URL, Force Organization URL.

Note: the System context object is a static type and will be replaced on form load.

User

Allows to get the current User information.

Note: the User context object is a static type and will be replaced on form load.

Form Parameters

Allows to get parameters passed to the form.

The Form Parameters context object is case sensitive.

Note: the Form Parameters context object is a static type and will be replaced on form load.

Variables

Allows to use Variables defined at the Tools -> Variables menu. See more details at Variables.

Variables can be Static and Dynamic depend on usage context. 

Whenever you see in the constructor definition like {$Variables.varName} (7) - it uses Static type.  

When you see field like {$Form.$Variables.varName} (8) - it uses Dynamic type.

Note: {$Form.$Variables.varName} can be used only when it is an option at current constructor menu. 

Parameters

The Parameters context object available on the form Actions. See more detail at Actions and Events.

Output

Allows to use output variables returned by Global Action/Global Action Group type Action.

Row

Row context object is specific to List and Related List form components. It allows to pass list row value(s) to form action as a parameters. Row context object is available in onChange, onSelect list events, along with the onClick event added to the standard list buttons (New, Edit, Delete, View).

Below is example setup of Account Name, stored in list row, passed to the form action when onSelect list event occurs.

Accounts List:

List Event Settings:

Parameters:

After selecting Row context object, one is to choose list column value to be passed to action. Row Id is always available for selection, even if it was not added as the list column.

0 Comments

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.