# Line Item Setting

Line Item Settings allow you to configure how configured product line items and option product line items are connected and how option information is mapped to line item fields.

<figure><img src="https://3800415611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNuSjRiJMvVhtdzNDzWBi%2Fuploads%2F10LRtHsOjVuSC6IeFuGY%2Fimage.png?alt=media&#x26;token=0019e3a9-d1e8-4e98-a924-48f7255381f8" alt=""><figcaption></figcaption></figure>

### Parent Line Item Field

Set the field that connects the line items of configured products to their option line items. This field must be a **self-relationship field**, **which represents a relationship within the same object**, allowing one record to reference another record in the same object.

{% hint style="info" %}
For **Opportunity Product**, the **Base Line Item for Option** (`SBLI__BaseLineItemForOption__c`) **field** is provided by default. When the standard settings for Opportunity are applied, this field is automatically set as the parent line item field. If needed, you can replace this with a different field.
{% endhint %}

<figure><img src="https://3800415611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNuSjRiJMvVhtdzNDzWBi%2Fuploads%2FzCy1PCqfwJdJchnhyrz1%2FLineItemParent.png?alt=media&#x26;token=2d8c38f1-457e-4c65-8901-af06ef5973f5" alt=""><figcaption></figcaption></figure>

#### Example

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

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

If the Parent Line Item Field is set to Base Line Item for Option (`SBLI__BaseLineItemForOption__c`), a self-relationship structure is created, enabling option records to reference their configured product record through this field.

#### Example in the Line Item Editor

<figure><img src="https://3800415611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNuSjRiJMvVhtdzNDzWBi%2Fuploads%2Fd1JvEUMGraFlMV8r3J2W%2FReference_Example.png?alt=media&#x26;token=f6cbbfc7-59b4-41a7-884c-f2e055b0d566" alt=""><figcaption></figcaption></figure>

### Mapping Option Values to Line Item Fields

<figure><img src="https://3800415611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNuSjRiJMvVhtdzNDzWBi%2Fuploads%2Fg3OXLSoVgubIBUqSLUVD%2FMApping.png?alt=media&#x26;token=dff90f3c-d5f3-4d34-8863-83243c12a1db" alt=""><figcaption></figcaption></figure>

Configure which line item fields will store the information of selected options. The following option values can be mapped:

<table><thead><tr><th width="177">Field</th><th width="338">Description</th><th width="130">Type</th><th>Required</th></tr></thead><tbody><tr><td><strong>Option Record Id</strong></td><td><p>Stores the record ID of the selected product option. This is used to fetch relevant option details when viewing line items in the editor. </p><p><br><span data-gb-custom-inline data-tag="emoji" data-code="2139">ℹ️</span> For <strong>Opportunity Product</strong>, the <strong>Product Option</strong> (<code>SBLI__ProductOption__c</code>) <strong>field</strong> is provided by default.</p></td><td>Lookup(Product Option)</td><td><mark style="color:red;">✔</mark></td></tr><tr><td><strong>Original Price</strong></td><td>Maps the <strong>list price</strong> of the option. If used for display purposes only, assign a line item field used for the list price column.</td><td>Currency</td><td></td></tr><tr><td><strong>Unit Price</strong></td><td>Maps the unit price of the option.</td><td>Currency</td><td></td></tr><tr><td><strong>Quantity</strong></td><td>Maps the quantity of the option.</td><td>Number</td><td></td></tr><tr><td><strong>Total Price</strong></td><td>Maps the total price <strong>calculated from the unit price and quantity</strong>. If used for display purposes only, assign a line item field used for the total price column.</td><td>Currency</td><td></td></tr><tr><td><strong>Discount (%)</strong></td><td>Maps the discount percentage of the option.</td><td>Percent</td><td></td></tr><tr><td><strong>Discount (Amount)</strong></td><td>Maps the discount amount of the option.</td><td>Currency</td><td></td></tr><tr><td><strong>Description</strong></td><td>Maps the description of the option.</td><td>Long Text Area(1000)</td><td></td></tr></tbody></table>

#### Example

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

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

<figure><img src="https://3800415611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNuSjRiJMvVhtdzNDzWBi%2Fuploads%2FYBfURCCahjUtzJcjsvOC%2Fimage.png?alt=media&#x26;token=d24f192b-53ed-4ed2-84b9-442e195bc68b" alt=""><figcaption></figcaption></figure>

for Opportunity Products, the following mappings might be configured:

| Option Value     | Opportunity Product FIeld |
| ---------------- | ------------------------- |
| Option Record ID | `SBLI__ProductOption__c`  |
| Original Price   | `ListPrice`               |
| Unit Price       | `UnitPrice`               |
| Quantity         | `Quantity`                |
| Total Price      | `TotalPrice`              |

#### Example in the Line Item Editor

For the configured product “**Desktop PC Intel i3**”, the RAM option “**RAM 8GB**” is selected. The option has a quantity of **1**, with a list price and unit price of **$45** each.&#x20;

<figure><img src="https://3800415611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNuSjRiJMvVhtdzNDzWBi%2Fuploads%2FXDR8bhEXXGTtFLkKNxYF%2FLineItemFieldEx01.png?alt=media&#x26;token=5f3de3e3-a6a5-4295-8822-4cbff07cb524" alt=""><figcaption></figcaption></figure>

The values for quantity, list price, unit price, and total price are mapped to their respective fields, as configured.

<figure><img src="https://3800415611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNuSjRiJMvVhtdzNDzWBi%2Fuploads%2F4ZMtGTfUgOLQlpQBbgsn%2FLineItemFieldEX02.png?alt=media&#x26;token=118ba4d1-35b9-4e01-a962-58b9cbe0fa52" alt=""><figcaption></figcaption></figure>
