JSON Specifications and Examples
When creating a Layout Settings record, the administrator leaves the Layout JSON field blank or fills it with the preconfigured JSON.
-
The JSON contains all settings for displayed tabs, sections, and fields within the record screen in the CT Mobile app.
-
The Layout JSON field will be automatically populated with the generated JSON after the administrator specifies tab and section settings in the CT Layouts Editor.
-
The Layout JSON field is automatically updated after the administrator makes and saves changes for tabs and sections in the CT Layouts Editor.
-
Before saving, the settings in the JSON format will be validated.
Click to expand the JSON example for the Tab mode
{
"version": 1,
"isCloseInProgressStepsAllowed": true,
"tabs": [
{
"label": "Visit Detail",
"sections": [
{
"label": "Visit",
"color": "hsl(11, 100, 50)",
"position": {
"x": 0,
"y": 0,
"width": 6,
"height": 20
},
"type": "Record",
"properties": {
"fields": [
{
"name": "AccountId__c",
"readOnly": true,
"required": false
},
{
"name": "ContactId__c",
"readOnly": true,
"required": false
},
{
"name": "Status__c",
"readOnly": true,
"required": false
},
{
"name": "StartDate__c",
"label": "Planned Start",
"readOnly": true,
"required": false
}
]
}
},
{
"label": "$Label.CustomerTitle",
"color": "hsl(11, 100, 50)",
"position": {
"x": 0,
"y": 20,
"width": 6,
"height": 20
},
"type": "ParentRecord",
"properties": {
"parentObject": "Contact",
"parentReference": "ContactId__c",
"fields": [
{
"name": "LastName",
"readOnly": true,
"required": false
},
{
"name": "FirstName",
"readOnly": true,
"required": false
},
{
"name": "Title",
"readOnly": false,
"required": true
},
{
"name": "Email",
"readOnly": false,
"required": false
},
{
"name": "MobilePhone",
"readOnly": false,
"required": false
}
]
}
}
]
},
{
"label": "$Label.CustomerTitle",
"sections": [
{
"label": "KPI Report",
"color": "hsl(11, 100, 50)",
"position": {
"x": 0,
"y": 20,
"width": 6,
"height": 20
},
"type": "RecordList",
"properties": {
"object": "ActivityData__c",
"objectCondition": "WHERE ActivityId__c = '{!Activity__c.ID}' AND RecordType.DeveloperName = 'KPI'",
"permission": {
"isCreatable": true,
"isLocalDeletable": true,
"isSyncedDeletable": false
},
"fields": [
{
"name": "KpiId__c",
"readOnly": true,
"required": false
},
{
"name": "Target__c",
"readOnly": true,
"required": false
},
{
"name": "Result__c",
"readOnly": false,
"required": true
}
]
}
}
]
}
]
}
Click to expand the JSON example of the Path mode
{
"version": 1,
"isCloseInProgressStepsAllowed": false,
"stepSettings": {
"statusField": "Status",
"isChangeDisplayedTabAllowed": true,
"newTab": {
"statuses": [
"New"
],
"updatable": "currentTab"
},
"inProgressTab": {
"statuses": [
"In Progress"
],
"updatable": "currentStatus"
},
"completedTab": {
"statuses": [
"Completed",
"Canceled"
],
"updatable": "readOnly"
}
},
"globalActions": [
{
"name": "previousTab",
"label": "Previous",
"icon": "chevronleft",
"iconPosition": "leading",
"onClickActions": [
{
"type": "navigate",
"destination": "$Tabs.previous"
}
]
},
{
"name": "nextTab",
"label": "Next",
"icon": "chevronright",
"iconPosition": "trailing",
"onClickActions": [
{
"type": "setValue",
"field": "Status",
"value": "$Tabs.next.statusValue"
},
{
"type": "navigate",
"destination": "$Tabs.next"
}
],
"hideCondition": {
"operator": "AND",
"items": [
{
"field": "Status",
"operator": "in",
"values": [
"New",
"In Progress"
]
},
{
"field": "$Tabs.current.isLast",
"operator": "equal",
"value": true
}
]
}
},
{
"name": "start",
"label": "Start visit",
"icon": "chevronright",
"iconPosition": "trailing",
"confirmationMessage": "Are you shure?",
"onClickActions": [
{
"type": "execute",
"action": "$Class.generateCGCloudTasks"
},
{
"type": "setValue",
"field": "ActualStartGeolocation__c",
"value": "$System.GeoCoordinates"
},
{
"type": "setValue",
"field": "ActualVisitStartTime",
"value": "$System.DateTime"
},
{
"type": "setValue",
"field": "Status",
"value": "In Progress"
},
{
"type": "waitWorkflows"
},
{
"type": "execute",
"action": "$Tabs.update"
},
{
"type": "navigate",
"destination": "$Tabs.next"
}
],
"showCondition": {
"operator": "AND",
"items": [
{
"field": "Status",
"operator": "equal",
"value": "New"
},
{
"field": "$Tabs.current.isLast",
"operator": "equal",
"value": true
}
]
}
},
{
"name": "finish",
"label": "Finish visit",
"onClickActions": [
{
"type": "setValue",
"field": "ActualEndGeolocation__c",
"value": "$System.GeoCoordinates"
},
{
"type": "setValue",
"field": "ActualVisitEndTime",
"value": "$System.DateTime"
},
{
"type": "setValue",
"field": "Status",
"value": "Completed"
},
{
"type": "navigate",
"destination": "$Tabs.next"
}
],
"showCondition": {
"operator": "AND",
"items": [
{
"field": "Status",
"operator": "equal",
"value": "In Progress"
},
{
"field": "$Tabs.current.isLast",
"operator": "equal",
"value": true
}
]
}
},
{
"name": "cancel",
"label": "Cancel visit",
"onClickActions": [
{
"type": "setValue",
"field": "ActualCancelGeolocation__c",
"value": "$System.GeoCoordinates"
},
{
"type": "setValue",
"field": "ActualVisitCancelTime__c",
"value": "$System.DateTime"
},
{
"type": "setValue",
"field": "Status",
"value": "Canceled"
}
],
"hideCondition": {
"operator": "AND",
"items": [
{
"field": "Status",
"operator": "in",
"values": [
"Completed",
"Canceled"
]
}
]
}
}
],
"tabs": [
{
"label": "Retail Store",
"statusValue": "New",
"alwaysDisplayedActions": [
"nextTab"
],
"alwaysHiddenActions": [
"cancel"
],
"sections": [
{
"label": "Visit",
"position": {
"x": 0,
"y": 0,
"width": 6,
"height": 20
},
"type": "ParentRecord",
"properties": {
"parentObject": "Account",
"parentReference": "PlaceId",
"fields": [
{
"name": "AccountId",
"readOnly": true,
"required": false
},
{
"name": "Address",
"readOnly": true,
"required": false
},
{
"name": "DeliveryMethod",
"readOnly": true,
"required": false
},
{
"name": "Description",
"readOnly": false,
"required": false
}
]
}
}
]
},
{
"label": "Visit Detail",
"statusValue": "New",
"sections": [
{
"label": "Visit",
"position": {
"x": 0,
"y": 0,
"width": 6,
"height": 20
},
"type": "Record",
"properties": {
"fields": [
{
"name": "AccountId",
"readOnly": true,
"required": false
},
{
"name": "PlaceId",
"readOnly": true,
"required": false
},
{
"name": "PlannedVisitStartTime",
"label": "Planned Start",
"readOnly": true,
"required": false
},
{
"name": "Status",
"readOnly": true,
"required": false
},
{
"name": "StatusRemarks",
"readOnly": false,
"required": false
}
]
}
}
]
},
{
"label": "Inventory Check",
"showSoqlCondition": "FROM RetailVisitKpi WHERE VisitId = '{!Visit.Id}' AND AssessmentTaskId.TaskType = 'InventoryCheck'",
"statusValue": "In Progress",
"sections": [
{
"label": "Inventory Check",
"position": {
"x": 0,
"y": 20,
"width": 6,
"height": 20
},
"type": "RecordList",
"properties": {
"object": "RetailVisitKpi",
"objectCondition": "WHERE VisitId = '{!Visit.Id}' AND AssessmentTaskId.TaskType = 'InventoryCheck'",
"permission": {
"isCreatable": false,
"isLocalDeletable": false,
"isSyncedDeletable": false
},
"fields": [
{
"name": "ProductCategoryId",
"readOnly": true,
"required": false
},
{
"name": "ProductId",
"readOnly": true,
"required": false
},
{
"name": "Type",
"readOnly": true,
"required": false
},
{
"name": "UnitOfMeasure",
"readOnly": true,
"required": false
},
{
"name": "CTLayouts__TargetValue",
"label": "Target Value",
"readOnly": true,
"required": false
},
{
"name": "CTLayouts__ActualValue",
"label": "Actual Value",
"readOnly": false,
"required": true
}
]
}
}
]
},
{
"label": "Promotion Check",
"showSoqlCondition": "FROM RetailVisitKpi WHERE VisitId = '{!Visit.Id}' AND AssessmentTaskId.TaskType = 'PromotionCheck'",
"statusValue": "In Progress",
"sections": [
{
"label": "Promotion Check",
"position": {
"x": 0,
"y": 20,
"width": 6,
"height": 20
},
"type": "RecordList",
"properties": {
"object": "RetailVisitKpi",
"objectCondition": "WHERE VisitId = '{!Visit.Id}' AND AssessmentTaskId.TaskType = 'PromotionCheck'",
"permission": {
"isCreatable": false,
"isLocalDeletable": false,
"isSyncedDeletable": false
},
"fields": [
{
"name": "PromotionId",
"readOnly": true,
"required": false
},
{
"name": "UnitOfMeasure",
"readOnly": true,
"required": false
},
{
"name": "CTLayouts__TargetValue",
"label": "Target Value",
"readOnly": true,
"required": false
},
{
"name": "CTLayouts__ActualValue",
"label": "Actual Value",
"readOnly": false,
"required": true
}
]
}
}
]
}
]
}
In this article, we describe allowed JSON keys and values.
The Global Setup for Displaying Tab or Path Mode
Keys
Using the Settings and Navigation buttons, the administrator defines high-level settings, such as displayed tab mode and allowed tab customization.
| Key | Type | Required | Comment | ||
|---|---|---|---|---|---|
globalActions |
An array of Global Actions |
Yes |
An array of one or more global actions that are specified for one or more navigation buttons.
|
||
hasCustomColors |
Boolean |
No |
true if the Custom Color Scheme checkbox is active to set up a color scheme.
|
||
hasCustomIcons |
Boolean |
No |
true if the Add icons for steps checkbox is active to specify icons from the standard Salesforce set for each tab.
|
||
isCloseInProgressStepsAllowed |
Boolean |
Yes |
true if the Allow close the steps in Progress checkbox is active to allow mobile users to close CT Layouts tabs in the In Progress status. |
||
stepSettings |
No |
true if the Path mode is set and the Status field is selected. |
|||
tabs |
An array of Tabs |
Yes |
List of tabs to display on a record screen.
|
||
version |
Number |
Yes |
The JSON version. Allowed values:
|
Step Settings
Using the Settings button, the administrator distributes the status filed values of the selected object in groups according to the tab status in the Path mode.
| Key | Type | Required | Comment |
|---|---|---|---|
completedTab |
Yes |
The status field values that are added in the Completed group of the tab statuses. |
|
isChangeDisplayedTabAllowed |
Boolean |
Yes |
true if the Allow change the displayed tab checkbox is active to allow mobile users to change the displayed tab. |
inProgressTab |
Path Tab Settings |
Yes |
The status field values that are added in the In Progress group of the tab statuses. |
newTab |
Path Tab Settings |
Yes |
The status field values that are added in the New group of the tab statuses. |
statusField |
String |
Yes |
The API name of the Status field of the selected object. |
Path Tab Settings
The administrator specifies user permissions for each tab, status, or group of tab statuses.
| Key | Type | Required | Comment | ||
|---|---|---|---|---|---|
statuses |
An array of String |
Yes |
The API names of stepSettings.statusField values.
|
||
updatable |
Enum |
Yes |
User permission on the tab for the Path mode. Available values:
|
Global Actions for Buttons in the Path Mode
Action Keys
On the General tab of the Navigation button, the administrator sets high-level settings for the selected navigation button, such as conditions for displaying the button on the tab, actions when a mobile user taps the button, and if there are several actions, the sequence of these actions.
| Key | Type | Required | Comment | ||||||
|---|---|---|---|---|---|---|---|---|---|
confirmationMessage |
String |
No |
If set, a confirmation message will be shown when the mobile user taps the button. Available values:
|
||||||
showCondition |
No |
By default, a button is displayed on every tab. To hide a button:
|
|||||||
hideCondition |
|||||||||
icon |
Enum |
No |
Icon name from the standard Salesforce set to display the selected icon on the button. The list of default values:
|
||||||
iconPosition |
Enum |
No |
Icon position on the button. Available positions:
|
||||||
label |
String |
Yes |
Any button label to show it in the CT Mobile app. The list of default values:
The default value may be changed. Available custom values:
|
||||||
name |
String |
Yes |
The button name. Available values:
|
||||||
onClickActions |
An array of Click Actions |
Yes |
Actions to perform when a mobile user taps the button.
|
Click Action Keys
On the Actions tab of the Navigation button, the administrator specifies action that triggered by a mobolie user’s tap on the button.
| Some actions are set for buttons by default but can be changed. |
| Key | Type | Required | Comment | ||
|---|---|---|---|---|---|
action |
String |
Yes |
The action name.
|
||
destination |
String |
Yes |
The required destination, for example, the previous or next tab.
|
||
field |
String |
Yes |
The API name of the current field.
|
||
object |
String |
Yes |
The API name of the object to create a record of.
|
||
recordType |
String |
Yes |
The record type for the object to create a record of.
|
||
type |
Enum |
Yes |
Available action types:
|
||
useMinilayout |
Boolean |
Yes |
If set, the mini layout is used to create the record.
|
||
value |
Boolean |
Yes |
The value for the "field".
|
||
Number |
|||||
String |
Action Condition
On the Conditions tab of the Navigation button, the administrator specifies conditions to show or hide a button on the tab.
Condition Level
Conditions can be set at different levels and combined into groups.
| Key | Type | Required | Comment | ||
|---|---|---|---|---|---|
operator |
Enum |
Yes |
Available values:
|
||
items |
Array |
Yes |
Each Item is a:
|
Condition Level Item
The specific condition for the level or group.
| The value and values keys are used when the operator is not equal to in and notIn. |
| Key | Type | Required | Comment | ||
|---|---|---|---|---|---|
field |
String |
Yes |
The API name of the current object field to check value or perform the specific context. |
||
operator |
Enum |
Yes |
Available operators depending on the field data type. |
||
value |
Boolean |
Yes |
Target values for fields with the Boolean data type. |
||
Number |
Target values for fields with the Currency and Number data type.
|
||||
String |
Target values for fields with the Text data type.
|
||||
values |
Array |
Yes |
The specific values in the Text data type.
|
Condition Operators
Check which operators can be used with the available field data types.
Field Data Type |
Operator |
|||||||||
contain |
notContain |
in |
notIn |
equal |
notEquel |
greater |
greaterOrEqual |
less |
lessOrEqual |
|
Currency |
No |
No |
No |
No |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Number |
No |
No |
No |
No |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Text |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
No |
No |
No |
No |
Tab Settings
Settings for each displayed tab of the Tab and Path mode on the record screen.
| Key | Type | Required | Comment | ||||
|---|---|---|---|---|---|---|---|
alwaysDisplayedActions |
An array of String |
No |
An array of the values for the name key of the global actions to always display or hide the specified button on the tab.
|
||||
alwaysHiddenActions |
|||||||
color |
String |
Yes |
The custom color of the tab. The format (case insensitive): HSL(11, 100, 50).
|
||||
icon |
Enum |
Yes |
The tab icon from the standard Salesforce set.
|
||||
label |
String |
Yes |
The label of the tab. Available values:
|
||||
sections |
Array of Sections |
Yes |
The list of sections on the tab.
|
||||
showSoqlCondition |
String |
No |
The SOQL filter to display tab only when the criteria are met.
For example:
|
||||
statusValue |
String |
Yes |
The API name of stepSettings.statusField value.
|
Section Settings
In the CT Layouts Editor, the administrator adds sections one after the other, starting from the leftmost top corner of the grid. Sections cannot overlap each other on the tab.
Section Keys
The general settings of the selected section.
| Key | Type | Required | Comment | ||||
|---|---|---|---|---|---|---|---|
color |
String |
Yes |
The custom color of the section.
|
||||
extension |
N/A |
No |
|
||||
icon |
Enum |
Yes |
The section icon from the standard Salesforce set.
|
||||
label |
String |
Yes |
The label of the section. Available values:
|
||||
position |
Yes |
Location of the section on the tab. |
|||||
properties |
Object |
Yes |
Properties for each object depend on the value in the type key. |
||||
type |
Enum |
Yes |
Type of section, which determines records of which object will be presented in it. Available types:
|
Section Position Keys
Indicated in grid units, location of the section on the tab.
| Key | Type | Required | Comment |
|---|---|---|---|
height |
Number |
Yes |
The section height in the grid units. |
width |
Number |
Yes |
The section width in the grid units. |
x |
Number |
Yes |
The X coordinate of the upper-left corner of the section. |
y |
Number |
Yes |
The Y coordinate of the upper-left corner of the section. |
Current Record: Properties
Specific properties are available for the Current Record section type.
| Key | Type | Required | Comment | ||
|---|---|---|---|---|---|
fields |
An array of Field Settings |
Yes |
Fields to display.
|
Parent Record: Properties
Specific properties are available for the Parent Record section type.
| Key | Type | Required | Comment | ||
|---|---|---|---|---|---|
fields |
An array of Field Settings |
Yes |
Fields to display.
|
||
parentObject |
String |
Yes |
The API name of the parent object. |
||
parentReference |
String |
Yes |
The API name of the field with the Lookup or Master-Detail type on the object specified in the Layout Settings record. |
Record List: Properties
Specific properties are available for the Record List section type.
| Key | Type | Required | Comment | ||
|---|---|---|---|---|---|
fields |
An array of Field Settings |
Yes |
Fields to display.
|
||
object |
String |
Yes |
The API name of any related object that has a filed with the Lookup or Master-Detail type to the object in the Layout Settings record. |
||
objectCondition |
String |
Yes |
The SOQL filter is used to define records of the related object to display within the section. Otherwise, all records will be displayed.
|
||
permission |
Yes |
User permissions to work with fields in the section. |
Record Permission Settings
User permission to each displayed field within the section.
|
The Field-Level Security settings for the field are higher than the field settings in the CT Layouts.
|
| Key | Type | Required | Comment |
|---|---|---|---|
isCreatable |
Boolean |
Yes |
Permission to create related records. |
isLocalDatabase |
Boolean |
Yes |
Permission to delete unsynchronized records from the mobile device. |
isSyncedDeletable |
Boolean |
Yes |
Permission to delete synchronized records. |
Field Settings
Field Keys
The data and user permissions for each displayed field in the sections.
| Key | Type | Required | Comment | ||||
|---|---|---|---|---|---|---|---|
label |
String |
Yes |
By default, the standard field label. To override it use:
|
||||
name |
String |
Yes |
The API name of the field |
||||
readOnly |
Boolean |
Yes |
true if the field should be read-only. |
||||
required |
Boolean |
Yes |
true if the field should be required to fill in. |
||||
width |
int(1…100) |
Yes |
By default, the width of each column is the same. The administrator can change the width of each column.
|