---
schema_version: "1"
id: 0ff8e0580a3e1f96012042438bc43a080dd4bb5431241c95957760e047c24b72
title: Edit Opportunity Line Item Nodes
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/aaf_customize_dpe_revenue_metrics_definition_opp.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.aaf_customize_dpe_revenue_metrics_definition_opp.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: e5d876ae0fa8c30b1231b870a398baf1791cac223fff34db7979c6b85b71ae34
description: To ensure that the fixed cost and variable cost of all products are included in Data Processing Engine calculations, update all nodes originating from Opportunity Line Item.
products:
  - Manufacturing
release: "264"
---
# Edit Opportunity Line Item Nodes

To ensure that the fixed cost and variable cost of all products are included in Data Processing Engine calculations, update all nodes originating from Opportunity Line Item.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d15017e69">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d15017e69 ">To edit a DPE definition:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d15017e69 ">
              <ul>
                <li>Customize Application</li>

                <li>Modify All Data</li>

              </ul>
            </td>

          </tr>
        </tbody>
      </table>

This example walks you through adding two custom fields, updating the required existing nodes, adding new nodes, and adding formulas to calculate the values. Finally, the values for fixed cost and total variable cost can be aggregated for all opportunity products for a forecast period.

1. Add the custom fields from Price Book Entry as data source fields on a node.
    1. Search for and select the **Opportunity Line Item** data source node, then click **Add Related Object**.
    2. Select **PricebookEntry** as the object.
    3. Click **Selected Fields** and select **Fixed Cost** and **Variable Cost**.
    4. Enter the alias for the fields as OpportunityLineItemFixedCost and OpportunityLineItemVariableCostPerUnit.
    5. Click **Done** and **Done**.
2. Create a formula node to calculate the total variable cost for opportunity line items.
    1. Click **New Node** and enter these details.
        
        Node Type: **Formula**
        
        Name: Compute OpportunityLineItemTotalVariableCost
    2. Save your changes.
    3. For Source Node, search for and select **Opportunity Line Item**.
    4. Enter these formula details.
        
        Alias: OpportunityLineItemTotalVariableCost
        
        Field Type: **Number**
        
        Number Length: 16
        
        Decimal Places: 2
        
        Formula: `{OpportunityLineItemQuantity} * {OpportunityLineItemVariableCostPerUnit}`
    5. Click **Done** and **Done**.
3. Update a join node to replace the source node with the new formula node.
    1. Search for and select **Filtered Opportunity Join Opportunity Line Item** and then update these details.
        
        Second Source Node: **Compute OpportunityLineItemTotalVariableCost**
        
        Selected Fields: **OpportunityLineItemTotalVariableCost**, **OpportunityLineItemTotalFixedCost**
    2. Click **Done** and **Done**.
4. Add the custom fields in all join nodes that follow the Filtered Opportunity Join Opportunity Line Item node.
    
    ![Tip](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-manufacturing-264-0-0-production-enus/71a7997a-6330-43f9-81ad-0e7c8f13997c/images/icon_tip.png)
    
    Tip To find the nodes that you need to update, you can follow the reference links provided at the bottom of a node’s detail page in the sentence “This node is referenced by # node.” Or you can search for the node name.
    
    1. Search for and select the **Join Upserted Account Forecast Set Partner** join node.
    2. In the First Node section, click **Selected Fields**.
    3. Add **OpportunityLineItemFixedCost** and **OpportunityLineItemTotalVariableCost** as fields and then click **Done**.
    4. For the Valid Opportunity Within Acct Frsct Set Partner Date Range Join Active Products and the Opportunity Metrics Data Join Account Forecast Set Partner Period Data join nodes, repeat the steps to add the OpportunityLineItemFixedCost and OpportunityLineItemTotalVariableCost fields.
5. Update formula nodes to ensure that the two computed values for total variable cost and fixed cost for opportunity line items show up for each forecast period. The opportunity close date must fall within a period’s start and end date.
    1. Search for and select the **Compare Opportunity Metric Line Item Close Date With Period Range For Facts** formula node.
    2. Click **Add Formula** and enter these details.
        
        Alias: ComputedFixedCost
        
        Field Type: **Number**
        
        Number Length: 16
        
        Decimal Places: 2
        
        Formula: `IF({OpportunityCloseDate} >= {PeriodStartDate} && {OpportunityCloseDate} <= {PeriodEndDate} ,{OpportunityLineItemFixedCost} , 0)`
    3. Click **Add Formula** again and enter these details.
        
        Alias: ComputedTotalVariableCost
        
        Field Type: **Number**
        
        Number Length: 16
        
        Decimal Places: 2
        
        Formula: `IF({OpportunityCloseDate} >= {PeriodStartDate} && {OpportunityCloseDate} <= {PeriodEndDate} ,{OpportunityLineItemTotalVariableCost} , 0)`
    4. Click **Done** and **Done**.
6. Update a slice node to ensure that the fields for ComputedTotalFixedCost and ComputedTotalVariableCost are retained in the downstream nodes.
    1. Search for and select the **Consolidate Field Names For Opportunity Metric Line Forecast Facts** slice node.
    2. Click **Selected Fields** and select the **ComputedTotalFixedCost** and **ComputedTotalVariableCost** fields.
    3. Click **Done** and **Done**.
7. Update a formula node to ensure that the Data Processing Engine computed values for fixed cost and variable cost assigned to orders is always defaulted to zero. Orders represent the actual business of a company and the costs must be derived from the orders reported in a given period.
    1. Search for and select the **Compare Order Metric Line Item Close Date With Period Range For Facts** formula node.
    2. Click **Add Formula** and enter these details.
        
        Alias: ComputedFixedCost
        
        Field Type: **Number**
        
        Number Length: 16
        
        Decimal Places: 2
        
        Formula: `0`
    3. Click **Add Formula** again and enter these details.
        
        Alias: ComputedTotalVariableCost
        
        Field Type: **Number**
        
        Number Length: 16
        
        Decimal Places: 2
        
        Formula: `0`
    4. Click **Done** and **Done**.
    5. Click the node reference link at the bottom of the page to open the **Consolidate Field Names For Order Metric Line Forecast Facts** slice node.
    6. Click **Selected Fields** and add the **ComputedTotalFixedCost** and **ComputedTotalVariableCost** fields.
    7. Click **Done** and **Done**.

The next step is to write back the computed values to Advanced Account Forecast Fact.