How to Hide Rebate Agreement Buttons
When you want to dynamically hide Rebate Agreement action buttons for the users, you have the following options:
Calculation Logic
You can define buttons that will not be visible to users in Rebate Agreements header logic. The header logic has to be run to hide the buttons.
To hide a button, use this code:
raProcessor.setRenderInfo("deleteButton","hide",true)
The list of all button names is available in description of the method setRenderInfo().
JSON Configuration
since 13.0
Which buttons to hide and when can be specified in the JSON definition of a Rebate Agreement Type, therefore it is not dependent on a calculation logic execution. You can configure criteria when some Rebate Agreement buttons shall be hidden to users, so that you offer them only those actions that make sense for them.
The criteria defined in the JSON configuration are evaluated dynamically, during each “refresh“, so only applicable choices are shown to the end users at all times. The configuration affects buttons visible on Detail page as well as contextual buttons on the List page.
The following buttons can be hidden in the JSON configuration (false = hidden):
"buttons": {
"addButton": false,
"copyButton": false,
"editButton": false,
"saveButton": false,
"cancelButton": false,
"deleteButton": false,
"moveToButton": false,
"removeButton": false,
"revokeButton": false,
"submitButton": false,
"addNoteButton": false,
"summaryButton": false,
"addItemsButton": false,
"editNoteButton": false,
"emailingButton": false,
"massEditButton": false,
"viewNoteButton": false,
"withdrawButton": false,
"addActionButton": false,
"addFolderButton": false,
"calculateButton": false,
"duplicateButton": false,
"editLabelButton": false,
"deleteNoteButton": false,
"editActionButton": false,
"viewActionButton": false,
"attachmentsButton": false,
"blockActionButton": false,
"deleteItemsButton": false,
"exportToPdfButton": false,
"recalculateButton": false,
"deleteActionButton": false,
"exportDetailButton": false,
"exportToWordButton": false,
"moveToFolderButton": false,
"rejectActionButton": false,
"reopenActionButton": false,
"viewWorkflowButton": false,
"workflowDenyButton": false,
"assignAccountButton": false,
"convertToDealButton": false,
"exportToExcelButton": false,
"deleteMultipleButton": false,
"duplicateItemsButton": false,
"markDoneActionButton": false,
"postponeActionButton": false,
"removeMultipleButton": false,
"asyncPublishingButton": false, //support removed in 14.0
"browseMenuItemsButton": false,
"copyToClipboardButton": false,
"markOfferAsLostButton": false,
"reconvertToDealButton": false,
"showExportToPdfButton": false,
"workflowApproveButton": false,
"showExportToWordButton": false,
"assignOpportunityButton": false,
"createNewRevisionButton": false,
"createOpportunityButton": false,
"deleteAttachmentsButton": false,
"moveItemsToFolderButton": false,
"showExportToExcelButton": false,
"switchBackToEmberButton": false,
"uploadAttachmentsButton": false,
"importItemsFromClipboard": false,
"recalculateChangedButton": false,
"workflowAddWatcherButton": false,
"downloadAttachmentsButton": false,
"viewWorkflowHistoryButton": false,
"workFlowAddApproverButton": false,
"copyItemsToClipboardButton": false,
"emailingAndSignatureButton": false,
"calculateChangesInputButton": false,
"calculateChangesItemsButton": false,
"startCreationWorkflowButton": false,
"calculateChangesOutputButton": false,
"finishCreationWorkflowButton": false,
"importItemsToClipboardButton": false,
"backStepCreationWorkflowButton": false,
"nextStepCreationWorkflowButton": false,
"markOfferAsLostWithReasonButton": false,
"finishCreationWorkflowAndSubmitButton": false,
"exportCSVButton": false, // on the Rebate Records tab
"exportPDFButton": false, // on the Rebate Records tab
"exportPNGButton": false, // on the Rebate Records tab
"exportPVGButton": false, // on the Rebate Records tab
"exportJPEGButton": false // on the Rebate Records tab
},
Note:
There is a difference between
deleteButton
anddeleteMultipleButton
. If you select two Rebate Agreements on the List page, one of which has thedeleteButton
enabled on the root level in the Rebate Agreement Type and the other one has thedeleteButton
disabled, the Delete button will be displayed and you will be able to delete both Rebate Agreements by this action. The reason is that when you select multiple Rebate Agreements, the button that is rendered is thedeleteMultipleButton
one. Therefore if you want to make sure that users do not delete a Rebate Agreement that they shouldn't you must disable also thedeleteMultipleButton
.On the list page you can have Rebate Agreements based on different Rebate Agreement Types. Some of the Rebate Agreement Types may use the JSON configuration to hide some context action buttons (Submit, Delete, etc.). When you select multiple Rebate Agreements where some have hidden buttons and some do not, the general rule is that when you select at least one Rebate Agreement which has a specific contextual button hidden, then the button is hidden for the whole selection.
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.
Â
Found an issue in documentation? Write to us.
Â