Edit Sales Agreement Product Schedule 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 Sales Agreement Product Schedule.

Required Editions

Available in: Lightning Experience
Available in: Enterprise, Unlimited, and Developer Editions
User Permissions Needed
To edit a DPE definition:
  • Customize Application
  • Modify All Data

Customizing a Data Processing Engine definition is complex. This example walks you through adding two custom fields, updating the required existing nodes for those fields, adding new nodes, and adding formulas to calculate the values of your custom fields. Finally, the values for fixed cost and total variable cost can be aggregated for all sales agreement 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 Sales Agreement Product Schedule data source node, then click Add Related Object.
    2. Select Sales Agreement Product.Pricebook Entry as the object.
    3. Click Selected Fields and select Fixed Cost and Variable Cost.
    4. Enter the alias for the fields as SAPSFixedCost and SAPSVariableCostPerUnit.
    5. Click Done and Done.
  2. Create a formula node to calculate the total variable cost for sales agreement products.
    1. Click New Node and enter these details.
      Node Type: Formula
      Name: Compute SAPSTotalVariableCost
    2. Save your changes.
    3. For Source Node, search for and select Sales Agreement Product Schedule.
    4. Enter these formula details.
      Alias: SAPSTotalVariableCost
      Field Type: Number
      Length: 16
      Decimal Places: 2
      Formula: {SAPSPlannedQuantity} * {SAPSVariableCostPerUnit}
    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 Sales Agreement Join Sales Agreement Product Schedule and then update these details.
      Second Source Node: Compute SAPSTotalVariableCost
      Selected Fields: SAPSTotalVariableCost, SAPSFixedCost
    2. Click Done and Done.
  4. Add the custom fields in all join nodes that follow the Filtered Sales Agreement Join Sales Agreement Product Schedule node.
    Tip
    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 Valid Sales Agreement Join Upserted Account Forecast Set Partner join node.
    2. In the First Node section, click Selected Fields.
    3. Add SAPSTotalVariableCost and SAPSFixedCost as fields and then click Done.
    4. For the following join nodes, repeat the steps to add the SAPSTotalVariableCost and SAPSFixedCost fields.
      • Valid Sales Agreement Within Acct Frcst Set Partner Date Range Join Active Prod
      • Valid Sales Agreement Join Account Forecast Set Partner Period Data
  5. Create group and aggregate nodes to eliminate duplicates from sales agreement product schedules and calculate average fixed cost.
    1. Click New Node and enter these details.
      Node Type: Group and Aggregate
      Name: Aggregate SAPS To Eliminate Duplicates For Period
    2. Save your changes.
    3. For Source Node, search for and select Filter Valid Period Nodes For SAPS Start Date And End Date.
    4. Click Selected Group Fields and select these fields, then click Done.
      • AdvanceAccountForecastSetId
      • SAAccountId
      • SAPProductId
      • SAPSEndDate
      • SAPSPeriodId
      • SAPSStartDate
    5. In the Aggregate section, specify these details.
      Alias: MaxFixedCostForSAPS
      Function: Max
      Aggregate Field: SAPSFixedCost
    6. Click Done and Done.
    7. Repeat these steps to create another group and aggregate node with these details.
      Node Type: Group and Aggregate
      Name: Aggregate SAPS To Calculate AverageFixedCost
      Source Node: Aggregate SAPS To Eliminate Duplicates For Period
      Selected Group Fields:
      • AdvanceAccountForecastSetId
      • SAAccountId
      • SAPProductId
      • SAPSPeriodId
      Alias: AverageFixedCost
      Function: Avg
      Aggregate Field: MaxFixedCostForSAPS
    8. Click Done to save your changes.
  6. Create a join node to retrieve fixed cost for aggregated sales agreement product schedules.
    1. Click New Node and enter these details.
      Node Type: Join
      Name: Fetch ComputedFixedCost For Aggregated SAPS
    2. Save your changes.
    3. For Join Type, select Left Outer.
    4. In the First Node section, search for and select Aggregate SAPS Records To Remove Duplicate For Forecast Facts.
    5. Click Select Fields and add all he fields, then click Done.
    6. In the Second Node section, search for and select Aggregate SAPS To Calculate AverageFixedCost.
    7. Click Select Fields, add AverageFixedCost, and rename its Alias as ComputedFixedCost. Then click Done.
    8. Map the following fields between the first node and second node.
      AdvanceAccountForecastSetId with AdvanceAccountForecastSetId
      AccountId with AccountId
      ProductId with SAPProductId
      PeriodId with SAPSPeriodId
    9. Click Done and Done.
  7. Update formula nodes to compute the value of consolidated total variable cost of all sales agreement products for a particular forecast period.
    1. Search for and select the Fetch Sales Price From Last Period For Calculation formula node.
    2. Click Add Formula and enter these details.
      Alias: LastPeriodSAPSTotalVariableCost
      Field Type: Number
      Number Length: 16
      Decimal Places: 2
      Formula: LASTVALUE({SAPSTotalVariableCost})
    3. Click Done and Done.
    4. Use the reference link at the bottom of the page to open the Determine Last Period Quantity And Revenue For SAPS Calculation formula node.
    5. Click Add Formula and enter these details.
      Alias: FinalizedLastPeriodSAPSTotalVariableCost
      Field Type: Number
      Number Length: 16
      Decimal Places: 2
      Formula: IF ({LastPeriodSAPSTotalVariableCost} == 0, {SAPSTotalVariableCost}, {LastPeriodSAPSTotalVariableCost})
    6. Click Done and Done.
    7. Use the reference link to open the Compute Quantity From Applicable Periods In SAPS Period Join Data formula node.
    8. Click Add Formula and enter these details.
      Alias: ApplicableTotalCostFromSAPSStartDate
      Field Type: Number
      Number Length: 16
      Decimal Places: 2
      Formula: IF ({IsValidPeriodNodeForSAPSStartDate} == 1, ( {ApplicableDaysFromSAPSStartDate} / {NumberOfDaysInCurrentSAPSSchedule} ) * {SAPSTotalVariableCost} , 0)
    9. Click Add Formula again and enter these details.
      Alias: ApplicableTotalCostToSAPSEndDate
      Field Type: Number
      Number Length: 16
      Decimal Places: 2
      Formula: IF ({IsValidPeriodNodeForSAPSEndDate} == 1, IF ({IsValidPeriodNodeForSAPSStartDate} == 0, ( {ApplicableDaysToSAPSEndDate} / {FinalizedNumberOfDaysInLastSAPSSchedule} ) * {FinalizedLastPeriodSAPSTotalVariableCost}, 0) , 0)
    10. Click Done and Done.
    11. Use the reference link to open the Compute Applicable Quantity And Revenue In SAPS Period Join Data formula node.
    12. Click Add Formula and enter these details.
      Alias: ApplicableTotalVariableCost
      Field Type: Number
      Number Length: 16
      Decimal Places: 2
      Formula: {ApplicableTotalCostToSAPSEndDate} + {ApplicableTotalCostFromSAPSStartDate}
    13. Click Done and Done.
  8. Aggregate the two computed values for total variable cost and fixed cost for sales agreement products for a particular forecast period.
    1. Search for and select the Aggregate Records To Consolidate SAPS Period Join Data group and aggregate node.
    2. Click Add Aggregate and enter these details.
      Alias: ConsolidatedTotalVariableCost
      Function: Sum
      Aggregate Field: ApplicableTotalVariableCost
    3. Click Add Aggregate again, and enter these details.
      Alias: MaxSAPSFixedCost
      Function: Max
      Aggregate Field: SAPSFixedCost
    4. Click Done and Done.
    5. Use the reference link to open the Sales Agreement Metrics Data Join Account Forecast Set Partner Period Data join node.
    6. In the First Node section, click Selected Fields and enter these details.
      Alias: ConsolidatedTotalVariableCost
      Alias: MaxSAPSFixedCost
    7. Click Done and Done.
    8. Use the reference link to open the Compare Sales Agreement Metric Line Item Close Date With Period Range formula node.
    9. Click Add Formula and enter these details.
      Alias: TotalVariableCostForCurrentPeriod
      Field Type: Number
      Number Length: 16
      Decimal Places: 2
      Formula: IF({LeftPeriodId}=={PeriodId} , IF({SalesAgreementEffectiveDate} >= {PeriodStartDate} && {SalesAgreementEffectiveDate} <= {PeriodEndDate} , {ConsolidatedTotalVariableCost} , 0),0)
    10. Click Done and Done.
    11. Use the reference link to open the Aggregate SAPS Records To Remove Duplicate For Forecast Facts node.
    12. Click Add Aggregate and enter these details.
      Alias: ComputedFixedCost
      Function: Max
      Aggregate Field: MaxSAPSFixedCost
    13. Click Done and Done.
    14. Use the reference link to open the Aggregate Records To Consolidate SAPS Period Join Data group and aggregate node.
    15. Click Add Aggregate and enter these details.
      Alias: ComputedTotalVariableCost
      Function: Sum
      Aggregate Field: TotalVariableCostForCurrentPeriod
    16. Click Done and Done.

Whew! That was a lot of customization. The next step is to change nodes originating from Opportunity Line Item.