Skip to main content

I want to hide this Delete and Edit Option from Opprtunity product please share steps 

 

our internal users creation quote in CPQ and that same quote and line flow into opportunity and products but after that filed users editing or deleting the opportunity line items from the opportunity products  

Restricted Opportunity products line delete and Edit Option

 

 

 

#Trailhead Challenges

1 answer
  1. May 13, 1:12 PM

    @Kiran Kharade - Vashi Integrated Solution Ltd, this is a permission/security requirement, not just a UI change.

    In the standard Opportunity Products related list, Edit and Delete appear based on the user’s access. Removing the buttons from the page layout can hide some related list actions, but it is not a proper security control.

    For Opportunity Products, Salesforce has a special access rule: users need Edit

    access on the Opportunity to create or update Opportunity Line Items. Reference: 

    https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_opportunitylineitem.htm

    If field users should not change Opportunity Products after CPQ sync, use one of these options:

    1. Remove their ability to edit the Opportunity after the quote is synced, if the business process allows it.
    2. Add a validation rule on Opportunity Product to block edits when the line came from CPQ.
    3. Add a before delete Apex trigger on OpportunityLineItem to block delete, because validation rules do not fire on delete.
    4. Use a custom permission, for example Manage_Opportunity_Products, so only CPQ/admin users can edit or delete lines.

    For the UI side, you can also remove the Products related list buttons from the Opportunity page layout, but do not rely on that alone. Reference: 

    https://help.salesforce.com/s/articleView?id=platform.customizing_related_lists.htm&type=5

     

    CPQ pattern is to make the Quote/Quote Lines the editable source and protect Opportunity Products after sync. Field users should update the quote, not manually edit or delete synced Opportunity Product records.

0/9000