Working with Context objects

When you are working with Flexi Kanban actions you can retrieve information about the current environment by using Flexi Kanban context objects. Context objects provides information to your source object, variables, current user, environment ect. You can use this information to setup complex logic on your actions.

The Flexi Kanban application supports the following set of context objects.

"Source Object" context object

When creating an Action you can set a Source object - the type of the object which will be used in action.

When source object is selected you can use its fields to build formulas or to compare its values with query outputs.

Select Context Object Type (1).

Now its fields (2) are available for using in formulas and queries. The application supports fields up to 4 level relationships.

"$User" context object

$User context object allows to work with currently logged in Salesforce user fields.

"$Variables" context object

$Variables context object contains the current context variables set, that you pass to the action/group or defined in previous actions in case of Action Group. But because user can define variables later and/or pass them from external event as parameters, the merge field picker usually contains only variable template field. User should insert it where needed and change "variableTemplate" text to actual variable name:

Parameters that user have passed to the Action, are available as $Variables context object properties.

"$System" context object

$System object contains the organization context information:

  • Date - value that indicating a current day.

  • DateTime - value indicating current day and time.

  • Time - value that indicates current time.

  • SessionID - current APEX session ID value.

  • Timestamp - current DateTime represented as a number of milliseconds since January 1, 1970, 00:00:00 GMT.

  • DomainUrl - base URL of current site.

  • IsBatch - returns true if the action is called from SF Batch.

  • IsFuture - returns true if the action is called from "future" method.

  • IsQueueable - returns true if the action is called from the SF Queue.

  • IsScheduled - returns true if the action is called from the SF Scheduled job.

"$Settings" context object

$Setting custom object allows to use the Flexi Kanban custom settings (Salesforce Custom Settings).

"$Functions" context object

This is not actually an object - selecting this option user can see a list of functions available.

Other Optional Objects

"$KanBan" context object

$KanBan context object is available only when the action is configured on the dashboard designer page and executed from kanban (within kanban context). It allows to get the dashboard specific properties.

  • ContextRecordId - ID of the record which is currently shown on the Record Page kanban is built in.

  • Description - the dashboard Description.

  • Guid - the dashboard unique internal ID.

  • Id - the dashboard Salesforce ID.

  • Name - the dashboard Name.

  • SelectedCards - list of IDs of cards that are selected (Kanban allows to select several cards to make bulk movement or actions)

  • SelectedRecords - list of IDs of records that selected cards are representing

  • SelectedView.Id - ID of currently selected View (set of filters and orders). Note: system "All Records" view has no ID.

  • SelectedView.IsDefault - boolean value (true/false) indicating is current View set as default or not.

  • SelectedView.Name - name of currently selected View.

  • Theme - the dashboard styling theme.

  • Type - the dashboard Type (Standard/Composite).

  • Variables - all the dashboard Variables in JSON format.

"$Card" context object

$Card context object is available only when the action is configured from the dashboard designer page. It allows to get Card specific info.

  • Id - the card Salesforce ID.

  • Name - the card Name.

  • Guid - the card unique internal ID.

  • Description - the card Description.

  • Index - the position of the Card in the dashboard.

  • KanBan - the card dashboard ID.

  • ObjectType - the object type for which the card is created.

  • SourceId - the ID of the card source record.

"$Column", "$SourceColumn", "$TargetColumn" context objects

$Column/$SourceColumn/$TargetColumn context objects are available only when the action is configured from the dashboard designer page. They allow to get Column specific info.

Select a $Column object if you are creating an action for the column or card. Select $SourceColumn/$TargetColumn objects if you need to make actions related to columns where you're dragging a card from/to.

$SourceColumn - where the card is dragged from $TargetColumn - where the card is dragged to

  • Id - the column Salesforce ID.

  • Name - the column Name.

  • Description - the column Description.

  • KanBan - the dashboard ID where the column is used.

  • Guid - the column unique custom ID.

  • Index - the position of the column in the dashboard.

  • ObjectType - the object type for which the column is created.

  • Status - the column Status.

Optionally there can be some additional parameters called custom attributes. It is something that user added in Column Settings:

"$Form" context object

$Form object contains the form-specific context information:

  • Form ID - ID of the current form

  • Virtual Field Name (and similar) - names of the fields added to form (user should know them because list of these fields can be available only in form builder with proper form loaded).

Last updated