From a6e4728f182430816cac026eee5760b0af4ec80c Mon Sep 17 00:00:00 2001 From: Reede Stockton Date: Wed, 18 Oct 2023 20:35:40 -0700 Subject: [PATCH] Add update check for Opportunity Name --- .../main/default/classes/OPP_OpportunityNamingBTN_CTRL.cls | 3 +++ 1 file changed, 3 insertions(+) diff --git a/force-app/main/default/classes/OPP_OpportunityNamingBTN_CTRL.cls b/force-app/main/default/classes/OPP_OpportunityNamingBTN_CTRL.cls index 0b608f46831..abacef4096a 100644 --- a/force-app/main/default/classes/OPP_OpportunityNamingBTN_CTRL.cls +++ b/force-app/main/default/classes/OPP_OpportunityNamingBTN_CTRL.cls @@ -55,6 +55,9 @@ public with sharing class OPP_OpportunityNamingBTN_CTRL { if (!thisOpp.isEmpty()) { OPP_OpportunityNaming.refreshOppNames(thisOpp); try { + if (!UTIL_Permissions.canUpdate('Opportunity', 'Name')) { + throw new AuraHandledException(System.Label.commonAccessErrorMessage); + } update thisOpp; redirect = true; } catch (Exception ex) {