function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DishaDisha 

Restrict User from Deleting the Line Items in salesforce but not in Big Machines

Hi All,

There is integration with Big Machines for CPQ. My requirement is if i click on delete button on Opportunity Product Related List in the opportunity Then message should be shown that "you cant deleline Line Items" but a user can edit or delete the line items in Big Machines that will be updated on opportunity Product in Salesforce.
Can anyone please tell me how to do this?

Thanks,
Disha
KaranrajKaranraj
Disha,

Opportunity Products premissions will be controlled by Opportunity records. If the user has edit or delete permission for oppoerunity record then he will also have same permission on Opportunity products related list. If you remove the permission at the parent level then it will automatically applied to the child level. So you don't have seperate permission for the Opportunity product object.

Then other option to overcome this override the delete button with custom visualforce page, so whenever user clicks the 'Delete' command link in the related list then it will automatically take your visualforce. Make sure that you have included standard controller as 'OpportunityLineItem' in visualforce page.

Thanks,
Karan
 
AshlekhAshlekh
Hi,

And you can write a trigger on Opportunity Product and restrict to user to delete the line items.

-Thanks
Ashlekh Gera 
DishaDisha
Hi,
Thanks for the help :-)
yes, I tried with trigger as well as VF page. But when  a product is deleted because a user edit the quote going  into BigMachines then also this trigger / VF page is executing that we dont want. Anyhow we can trigger this only when we are deleting in Salesforce.

Let me know if I am not clear.

Thanks,
Disha