Skip to main content

Customize the Cloned DPE Definition

Learning Objectives 

After completing this unit, you’ll be able to:

  • Add and edit fields in each node of a DPE definition.
  • Update the Aggregate by Member DPE definition with custom logic.

Recap and the Way Ahead

So far, Rishi has set up a rebate program and its benefits based on the requirements he received from account managers in AMER. To account for product category and total discounted transaction amount data, he collaborated with Cindy to create custom fields in objects Transaction Journal, Rebate Member Product Aggregate, and Program Rebate Type Benefit. Cindy has cloned the Aggregate by Member definition and discussed the existing nodes with Rishi.

It’s now time to customize the Aggregate by Member_AMER Rebate Program Aggregation definition.

Do you recall the additional requirements from Unit 1? Rayler Parts wants the aggregation object, Rebate Member Product Aggregate, to group records by Product Category and show aggregated data for Total Discounted Transaction Amount.

Let’s follow along as Cindy and Rishi customize the cloned definition to meet the additional field requirements.

Note

You can’t edit an active DPE definition. Make sure you deactivate the definition that you want to edit. To do so, select the DPE definition from the Data Processing Engines page in Setup and click Deactivate.

Define Your Data Sources

First, Cindy adds the new fields for Transaction Journal and Rebate Member Product Aggregate to the corresponding data sources.

  1. On the Nodes tab, click Transaction Journal.
  2. Click Selected Fields.
  3. Select Discounted_Transaction _Amount_c.
  4. Click Done and Done.
    The list of selected fields for the Transaction Journal data source node, with the Discounted Transaction Amount custom field highlighted.
  5. On the Nodes tab, click Rebate Member Product Aggregate.
  6. Click Selected Fields.
  7. Select ProductCategory_c.
  8. Select Total_Discounted_Transaction_Amount_c.
    The list of selected fields for the Rebate Member Product Aggregate data source node, with Discounted Transaction Amount and Product Category highlighted.
  9. Click Done, and Done.

Surface the Total Discounted Transaction Amount for Aggregation

Now that Rishi and Cindy have added the fields, they concentrate on the first requirement. The Rebate Member Product Aggregate object is only showing the aggregate value for the total transaction amount. Rayler Parts wants to add a similar aggregate field that shows the total transaction amount after discounts have been applied by account managers.

Rishi notices that each node has information about the next node where the current node is referenced and used. Cindy follows this trail to make changes in the intended sequence.

Here’s what they do to add a new aggregate value field.

  1. Click the Transaction Journal data source node and ensure that Discounted_Transaction _Amount_c is a selected field. Click the link to the reference node.
  2. There are no changes required in the Filter Journals to Usage Type node. Click the link to the reference node.
  3. On the Add Rebate Type and Payout Period to Transaction Journals join node, click Selected Fields for the First Node (Filter Journals by Usage Type) to add the Discounted_Transaction_Amount_c field.
    The list of selected fields for the Add Rebate Type and Payout Period to Transaction Journals join node, with Discounted Transaction Amount highlighted.
  4. Click Done and Done.
  5. There are no changes required in the following nodes.
    • Compute Transaction Journals With Activity Dates
    • Filter Transaction Journals With Valid Activity Dates
  6. On the Valid Activity Dated Journals with Program Rebate Type Product node, click Selected Fields for the first node (Filter Transaction Journals With Valid Activity Dates) to select the Discounted_Transaction_Amount_c field. Click the link to the reference node.The list of selected fields for the Valid Activity Dated Journals with Program Rebate Type Product join node, with Discounted_Transaction_Amount_c highlighted.
  7. There are no changes required in the following nodes:
    • Filter Journals For Valid Products node.
    • Compute Valid Transaction Journals Per Rebate Type
    • Filter Valid Transaction Journals For Rebate Types
  8. On the Total Transaction Amount and Total Quantity group and aggregate node, click Add Aggregate.
  9. Provide the following details.
    • Select Function: Sum
    • Select Aggregate Field: Discounted_Transaction_Amount_c.
  10. Click Done.The Group and Aggregate node window where the admin can add an aggregate row for a specific field.
  11. On the Look Up Existing Aggregate Data join node, click Selected Fields for the First Node (Total Transaction Amount and Total Quantity) to add the TotalDiscountedTransactionAmount field.The list of selected fields for the Look Up Existing Aggregate Data join node, with Total Discounted Transaction Amount highlighted.
  12. Click Selected Fields for the Second Node (Rebate Member Product Aggregate) to add the TotalDiscountedTransactionAmount field.
  13. Click Done.
  14. On the Compute New Or Updated Aggregate Records formula node, change the formula to the following:
    “IF(({TotalAggQuanity} == {TotalQuantity}) && ({TotalAggAmount} == {TotalTransactionAmount}) && ({TotalDiscountedTransactionAmount} == {TotalDiscountedTransactionAmount}), 0,1)”.
    Validate the syntax and click Done.
    The Formula Builder in the Compute New Or Updated Aggregate Records formula node.
  15. There are no changes required in the Filter New or Updated Aggregate Records node.
  16. On the Upsert Total Transaction Amount and Total Quantity writeback node, click Add Row.
  17. Select the Source Node as TotalDiscountedTransactionAmount, and the Target Field as Total_Discounted_Transaction_Amount_c.
  18. Click Done.
    The mapping of source and target object fields in the Upsert Total Transaction Amount and Total Quantity writeback node.
  19. Click Save on the header of the builder.

Cindy has successfully created a new aggregation field on the Rebate Member Product Aggregate object and tied it to the existing rules of the predefined definition Aggregate by Member. The field will sum up the values of Discounted Transaction Amount across all valid transaction journal records to provide a single aggregate value per member row.

Group Data by Product Category

Rishi turns to the second requirement. Currently, each aggregation row in the Rebate Member Product Aggregate object shows data per program member. For a particular rebate type and a specific payout period, a single row is created for a program member. But account managers would like to see one row per program member, per product category. To take an example, even if Haven Enterprises had transactions for both hammers and compactors, the aggregate record would show no indication of that.

  • Haven Enterprises, Jan’21, Volume Rebate, 300 qty, $30,000

The aggregate records need to be also grouped by product category to show transactions across both the products.

  • Haven Enterprises, Hammers, Jan’21, Volume Rebate, 200 qty, $10,000
  • Haven Enterprises, Compactors, Jan’21, Volume Rebate, 100 qty, $20,000

Let’s follow along as Cindy and Rishi tweak the DPE definition to get the desired results.

There are two parallel paths from the following data source nodes where Cindy must make changes.

  • In the Rebate Member Product Aggregate source node, Cindy already added Product Category as a field.
  • In the Transaction Journal source node, Product Category ID is available as an out-of-the-box field but Cindy needs to select it.

First up, Cindy follows the trail of referenced nodes for Transaction Journal to make updates.

  1. Click the Transaction Journal data source node and ensure that ProductCategory is a selected field. Click the link to the reference node.
    The list of selected fields for the Transaction Journal data source node, with Product Category ID highlighted.
  2. There are no changes required in the Filter Journals by Usage Type node.
  3. On the Add Rebate Type and Payout Period to Transaction Journals join node, click Selected Fields for the First Node (Filter Journals By Usage Type), and select ProductCategoryId.
  4. Click Done and Done.
    The list of selected fields for the Add Rebate Type and Payout Period to Transaction Journals join node, with Product Category ID highlighted.
  5. There are no changes required in the next two reference nodes.
    • Compute Transaction Journals With Activity Dates.
    • Filter Transaction Journals With Valid Activity Dates
  6. On the Valid Activity Dated Journals with Program Rebate Type Product node, click Selected Fields for the first node (Filter Transaction Journals With Valid Activity Dates) to select the ProductCategory field. Click the link to the reference node.
  7. There are no changes required in the following nodes:
    • Filter Journals For Valid Products
    • Compute Valid Transaction Journals Per Rebate Type
    • Filter Valid Transaction Journals For Rebate Types
  8. On the Total Transaction Amount and Total Quantity group and aggregate node, click Selected Group Fields.
  9. Select ProductCategoryId.
  10. Click Done, and Done.
    The list of selected fields for the Total Transaction Amount and Total Quantity group and aggregate node, with Product Category ID highlighted.
  11. On the Look Up Existing Aggregate Data join node, click Selected Fields for the First Node (Total Transaction Amount and Total Quantity), and select ProductCategoryId. Add the alias ProductCategoryId.
  12. Click Done.
    The list of selected fields for the Total Transaction Amount and Total Quantity group and aggregate node, with Product Category ID highlighted.
  13. On the Look Up Existing Aggregate Data join node, click Selected Fields for the First Node (Total Transaction Amount and Total Quantity), and select ProductCategoryId.
  14. Click Done.
  15. Click Add Map, and select the following.
    • First Node Field: ProductCategoryId
    • Second Node Field: Product_Category
  16. Click Done.A row in the Look Up Existing Aggregate Data join node.
  17. There are no changes required in the next two reference nodes.
    • Compute New Or Updated Aggregate Records
    • Filter New or Updated Aggregate Records
  18. Click Save.

Next, Cindy follows the trail of referenced nodes for Rebate Member Product Aggregate to make updates.

  1. Click the Rebate Member Product Aggregate data source node, and click the link to the referenced node.
  2. On the Look Up Existing Aggregate Data join node, click Selected Fields for the Second Node (Rebate Member Product Aggregate), and select Product Category.
  3. Click Done and Done.
  4. There are no changes required in the next two reference nodes.
    • Compute New or Updated Aggregate Records
    • Filter New or Updated Aggregate Records
  5. Click Save.

Following both trails, Cindy ends up in the final writeback node. Now, it’s time to connect the dots. 

  1. On the Upsert Total Transaction Amount and Total Quantity writeback node, click Add Row.
  2. Select the following.
    • Source Node Field: ProductCategoryId (derived from Transaction Journal)
    • Target Field: Product_Category__c (derived from Rebate Member Product Aggregate)
  3. Click Done.
  4. Click Save.
    The mapping of source and target object fields in the Upsert Total Transaction Amount and Total Quantity writeback node.

Cindy and Rishi have customized the Aggregate by Member DPE definition to group and aggregate data in new ways for a rebate program. Account managers can track transaction amounts both before and after the discount. And they have granular visibility into eligible payout data for specific product categories for each partner. In the next unit, we do a test run of the DPE definition and check the output.

Resources

Condividi il tuo feedback su Trailhead dalla Guida di Salesforce.

Conoscere la tua esperienza su Trailhead è importante per noi. Ora puoi accedere al modulo per l'invio di feedback in qualsiasi momento dal sito della Guida di Salesforce.

Scopri di più Continua a condividere il tuo feedback