# 조건에 따라 라인 아이템 삭제 제어하기

저장된 라인 아이템의 상태에 따라 삭제를 제어하고 싶다면, Boolean 유형의 필드를 지정하여 삭제 가능 여부를 설정할 수 있습니다. 지정된 필드 값이 `true`(참)인 경우, 해당 라인 아이템에 대해 삭제 버튼을 비활성화할 수 있습니다.

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

{% hint style="warning" %}
삭제 제어는 라인 아이템 편집기 화면에서만 작동하며, Salesforce 내부 트랜잭션(예: API, 데이터 로더, 또는 수동 삭제)에서는 제어되지 않습니다.
{% endhint %}

### 예시: 승인된 상태의 기회 제품 삭제 불가 설정

{% hint style="info" %}
이 예시에서는 기회 제품에 대한 라인 아이템 편집기를 설정하였습니다.

* **부모:** 기회(`Opportunity`)
* **라인 아이템:** 기회 제품(`OpportunityLineItem`)
* **조회:** 가격 목록 항목(`PricebookEntry`)
  {% endhint %}

기회의 라인 아이템인 기회 제품이 승인된 경우, 삭제가 불가능하도록 설정하려고 합니다. 이를 위해 승인됨(`Approved__c`) 필드를 사용하여 삭제 제어를 구성하였습니다.

#### 빌더 설정

삭제 제어 필드에 승인됨(`Approved__c`) 필드 API명을 입력합니다.

<figure><img src="/files/3UEaSliNSo4WPNFTltMJ" alt=""><figcaption></figcaption></figure>

#### 결과

승인됨(`Approved__c`) 필드값이 `true`인 경우에만 삭제 버튼이 노출되지 않는 것을 확인하실 수 있습니다.

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.smallbuilder.com/ko/smallbuilder-line-items/builder/builder-setup-steps/relate-objects/line-item-object/deletion-control.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
