_img alt="Delete" src="https://kemxp52623.i.lithium.com/t5/image/serverpage/image-id/507i7CFACCD7A2113F62/image-size/original?v=mpbl-1&px=-1" /_ Delete Button
By default, it is not possible to remove delete button from certain quote lines. It is somewhat surprising that Salesforce CPQ doensn't allow configuring a filter to hide specific buttons at the Quote Line level.
The only target object that supports evaluating a Custom Action Condition for a Custom Action displayed in the QLE (Quote Line Editor) is Quote. The documentation states: "Custom actions can’t be conditionally shown or hidden on specific lines."
I emphasize "only target object" because, when selecting Product as the target object, the documentation specifies: "Conditions can evaluate product fields only if your custom action appears in the configurator.”
There are many use cases where preventing the deletion of a specific Quote Line would be extremely valuable.
For instance, consider a Quote Line that represents transportation costs. This line (always one per Quote) is automatically added using a Product Rule, and its populated automatically through Price Rules. If you have a button that allows users to delete lines, it would be ideal to block deletion of this line, since every Quote containing products must include this cost.
What other options do we have?
One alternative, although it result in a poor user experience, is to cerate a validation type Product Rule. The problem is that this doesn't prevent the Quote Line from being deleted. Instead, once the user deletes the line and attempts to save, a validation error appears. To save successfully, the user would have to manually re-add the deleted product.
From there, I considered creating a Product Rule that automatically re-adds the missing product. However, after several tests, I was unable to make this work. Based on the documentation, it never going to work: "Quote-scoped product rules run only during product selection or bundle configuration. If the product rule’s error condition is based on quote or quote line data, Salesforce CPQ doesn’t evaluate the error condition until quote lines are added, which can require a second save during product bundle reconfiguration or product selection."