How to Hide Custom Form Buttons Using JSON Configuration
since 13.0
Dynamic hiding of buttons in a Custom Form allows for a tailored user experience by specifying which buttons to hide and when in the JSON definition of a Custom Form Type. This configuration enables you to set criteria for when certain buttons should be hidden, ensuring that users are presented only with actions that are relevant to them.
The criteria defined in the JSON configuration are evaluated dynamically during each "refresh," ensuring that only applicable options are displayed to end users at all times. This configuration impacts both the buttons visible on the Detail page and the contextual buttons on the List page.
The following buttons can be hidden in the JSON configuration (false = hidden):
"buttons": {
"duplicateButton": false,
"withdrawButton": false,
"revisionButton": false,
"submitButton": false,
"revokeButton": false,
"deleteButton": false,
"workFlowAddApproverButton": false, // on the Workflow tab
"workflowAddWatcherButton": false, // on the Workflow tab
"workflowApproveButton": false, // on the Workflow tab
"workflowDenyButton": false, // on the Workflow tab
"recalculateButton": false, // on the Details tab
"downloadAttachmentsButton": false, // on the Attachments tab
"deleteAttachmentsButton": false, // on the Attachments tab
"uploadAttachmentsButton": false, // on the Attachments tab
"reopenActionButton": false, // on the Actions tab
"markDoneActionButton": false, // on the Actions tab
"blockActionButton": false, // on the Actions tab
"postponeActionButton": false, // on the Actions tab
"rejectActionButton": false, // on the Actions tab
"addActionButton": false, // on the Actions tab
"editActionButton": false, // on the Actions tab
"viewActionButton": false, // on the Actions tab
"deleteActionButton": false // on the Actions tab
},
Note:
On the list page you can have Custom Forms based on different Custom Form Types. Some of the Custom Form Types may use the JSON configuration to hide some context action buttons (Submit, Delete, etc.). When you select multiple Custom Forms where some have hidden buttons and some do not, the general rule is that when you select at least one Custom Form which has a specific contextual button hidden, then the button is hidden for the whole selection.
Hiding the buttons on the Dashboards, Messages and Configuration Wizards tabs via JSON configuration is not supported.
Buttons can be hidden on tab or document (root) level. Criteria for dynamic display of buttons are defined in the same way as for tabs or steps, using hard-coded columns, attribute columns or attribute extensions.
See the following example:
{
"name": "My Quote Type",
"tabs": [
{
"icon": "file-info-alt",
"name": "header",
"type": "header",
"buttons": {
"submitButton": {
"criteria": [
{
"value": "sales_managers, sales_team",
"operator": "groupIncludes",
"fieldName": "userGroupEdit",
"_constructor": "AdvancedCriteria"
}
],
"operator": "and",
"_constructor": "AdvancedCriteria"
}
},
"translationKey": "dynamicTab_keyInformation"
},
{
"name": "items",
"type": "items",
"translationKey": "sfdc_quotes_tabs_items",
},
{
"icon": "calculator",
"name": "customObject",
"type": "customForms",
"buttons": {
"calculateButton": false,
"recalculateButton": false
},
"typeReference": "CFO_Embedded",
"translationKey": "Custom Form"
},
{
"icon": "red",
"name": "workflow",
"type": "workflow",
"translationKey": "Workflow"
},
{
"icon": "file-check-alt",
"name": "actions",
"type": "actions",
"translationKey": "dynamicTab_actions"
}
],
"buttons": { // root level - buttons will be hidden both on list and detail page
"deleteButton": false,
"revokeButton": false,
"submitButton": true,
"duplicateButton": false,
"editLabelButton": false
}
}
How button visibility is determined between root and tab settings:
Button visibility is defined on tab level → the button on this tab behaves according to this definition.
Button visibility is not defined on the tab level → the button behaves according to the root-level definition.
If button visibility is not defined neither on the root level, the button is displayed because no definition means that the button is always visible.Button visibility is defined on the root level → the button on the list page behaves according to this definition.
Button visibility is not defined on the root level → button is displayed on the list page.
In the following example, the Submit button’s visibility on the Details tab is determined by the filter. On the Actions and Workflow tabs, the Submit button is hidden because "submitButton": false
is set on the root level. That also means that the Submit button is hidden on the List page as well.
{
"name": "My Quote Type",
"tabs": [
{
"icon": "file-info-alt",
"name": "details",
"type": "details",
"buttons": {
"submitButton": {
"criteria": [
{
"value": "sales_managers, unity_test_users",
"operator": "groupIncludes",
"fieldName": "userGroupEdit",
"_constructor": "AdvancedCriteria"
}
],
"operator": "and",
"_constructor": "AdvancedCriteria"
}
},
"translationKey": "dynamicTab_keyInformation"
},
{
"icon": "red",
"name": "workflow",
"type": "workflow",
"translationKey": "Workflow"
},
{
"icon": "file-check-alt",
"name": "actions",
"type": "actions",
"translationKey": "dynamicTab_actions"
}
],
"buttons": {
"editButton": false,
"deleteButton": false,
"revokeButton": false,
"submitButton": false,
"duplicateButton": false
}
}
Â
Found an issue in documentation? Write to us.
Â