Hello,
I have some actions I would like to remove from the CasePage and CaseSection. The problem is is that the method getSectionActions is only called on the CaseSection page which makes sense, but this method does not get called with the action menu items that I would like to remove.
For instance I want to remove the actions "Escalate" and "Reclassify". These localizable strings are not in the CaseSection page but rather the CasePage. That being said, getSectionAction doesn't get called with this item, and getSectionAction is never called on the CasePage at all.
My code on the CasePage.
getSectionActions: function() { var actionMenuItems = this.callParent(arguments); actionMenuItems.each(function(item) { if(item.values.Caption.bindTo === "Resources.Strings.EscalationTitle" || item.values.Caption.bindTo === "Resources.Strings.ReclassificationTitle"){ // Although this item shows up on the case page actions, it // never gets here because there is no item in this array. item.values.Visible = false; } }); return actionMenuItems; }
Any help is appreciated thanks
Like
In order to remove some actions on the Case page please override the getActions function on the CasePage schema.
Please feel free to use the example below:
define("CasePage", [], function() {
return {
entitySchemaName: "Case",
attributes: {},
modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
methods: {
getActions: function(){
var actionItems = this.callParent(arguments);
const newActionItems = actionItems.filter((item) => item.values.Caption !== "Escalate" && item.values.Caption !== "Reclassify");
return newActionItems;
}
},
dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,
diff: /**SCHEMA_DIFF*/[
]/**SCHEMA_DIFF*/
};
});