> For the complete documentation index, see [llms.txt](https://help.smallbuilder.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.smallbuilder.com/smallbuilder-line-items/builder/builder-setup-steps/relate-objects/line-item-object/control-line-item-deletion.md).

# Control Line Item Deletion

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.

<figure><img src="/files/2djRL3MMn8muEyhENgFw" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
DelDeletion control applies only within the Line Item Editor and does not affect Salesforce internal processes like API operations, Data Loader, or manual deletion.
{% endhint %}

### Example: Restrict Deletion of Approved Opportunity Products

{% hint style="info" %}
This example demonstrates the configuration of a Line Item Editor for Opportunity Products:

* **Parent:** Opportunity
* **Line Item:** OpportunityLineItem
* **Lookup:** PricebookEntry
  {% endhint %}

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.

#### Builder Setup

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.

<figure><img src="/files/roU2ESuoHsXnTTYE6dgY" alt=""><figcaption></figcaption></figure>

#### Result

When the `Approved__c` field value is true, the delete button is hidden, preventing deletion of the corresponding line item.

<figure><img src="/files/mudQUlwdactcyWvSQvdj" alt=""><figcaption></figcaption></figure>
