Control Line Item Deletion
Last updated
Last updated
Control the deletion of saved line items based on their status by specifying a Boolean field that determines whether deletion is allowed. If the specified field value is true, the delete button will be disabled for the corresponding line item.
DelDeletion control applies only within the Line Item Editor and does not affect Salesforce internal processes like API operations, Data Loader, or manual deletion.
This example demonstrates the configuration of a Line Item Editor for Opportunity Products:
Parent: Opportunity
Line Item: OpportunityLineItem
Lookup: PricebookEntry
For Opportunity Products linked to an Opportunity, deletion should be restricted when the product is in an approved state. To configure this, the Approved__c
field is used to control deletion.
Set the Approved__c
field as the deletion control field in the builder. Enter the API name of the field into the Deletion Control Field setting.
When the Approved__c
field value is true, the delete button is hidden, preventing deletion of the corresponding line item.