У нас вы можете посмотреть бесплатно OOTB31: How to Use Custom Permission in Apex Trigger in 2025 || Secure Product Updates или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
In this Salesforce tutorial, you’ll learn how to control product deactivation using Custom Permissions inside an Apex Trigger. This approach lets you protect critical data by ensuring that only users with a specific custom permission can deactivate a Product record. We’ll walk through: • Creating a Custom Permission • Adding it to a Permission Set • Assigning the Permission Set to selected users • Writing an Apex Trigger that checks the user’s custom permission before allowing deactivation If the user does not have the permission, the trigger prevents the update and shows a clear error message. This method keeps your org secure, avoids hardcoding user Ids, and gives admins full control over who can deactivate products. Great for Salesforce Admins, Developers, and anyone preparing for Admin or Platform Developer certifications. =========================== Timestamps 00:00 Introduction 02:05 Create Custom Permission 02:50 Add Permission to Permission Set 05:15 Create Apex Trigger 08:55 Use Custom Permission in Trigger 11:55 Demo: Trigger in Action 12:30 Assign to a User =========================== Trigger Code: trigger ProductTrigger on Product2 (before update) { for(Product2 prod: Trigger.New){ Product2 oldProd =Trigger.oldmap.get(prod.Id); // Check if user is trying to deactivate the product if(oldProd.IsActive == true && prod.IsActive == false){ // Validate Custom Permission if(!FeatureManagement.checkPermission('Configure_Product_CP')){ prod.IsActive = true; prod.addError('You do not have permission to deactivate this product'); } } } } =========================== Playlists: SALESFORCE FLOWS PLAYLIST: • FLOWS OMNISTUDIO PLAYLIST: • BUSINESS RULES ENGINE || OMNISTUDIO SALESFORCE OUT OF THE BOX PLAYLIST: • SALESFORCE OUT OF THE BOX SALESFORCE APEX TRIGGERS PLAYLIST: • APEX TRIGGERS SALESFORCE AGENTSTUDIO PLAYLIST: • AGENTSTUDIO SALESFORCE DATA CLOUD PLAYLIST: • DATA CLOUD =========================== FOLLOW ME ON: Instagram: / caminos_infinitos_26 LinkedIn: / linkedin.com/in/pariplab-pal-077554160 @SalesforceAIChampions @pariplabpal =========================== #salesforce #apex #custompermission #salesforceadmin #salesforcedeveloper #salesforcetutorial #salesforce2025 #apextrigger