Clone and Customize the Predefined Data Processing Engine Definition for Collections Summary

Clone and Customize the Predefined Data Processing Engine Definition for Collections Summary

Clone and customize the predefined Data Processing Engine definition. This definition is designed to compute the aggregated summary of specific collection plan fields, such as the initial amount due, current amount due, payments received, and the average days past due for all collection plans linked to an account.

Required Editions

Available in: Lightning Experience
Available in: View product and edition availability.
User Permissions Needed
To clone and customize the prebuilt Data Processing Engine definition:

Collections and Recovery Admin permission set

AND

Customize Application permission

AND

Modify All Data permission

AND

Data Pipelines Base User permission set

  1. From Setup, in the Quick Find box, enter Data Processing Engine, and then select Data Processing Engine.
  2. To download the predefined Data Processing Engine definition, Collections Summary for Account, from the action menu, click Download Data Processing Engine Definition.
  3. Open the definition that you downloaded, which is in the JSON format.
  4. Replace the FullName according to your requirements. For example, CollectionsSummaryForCaroleWhite. Make sure that the full name doesn't contain any spaces or special characters.
    {
      "FullName": "CollectionsSummaryForCaroleWhite",
      "Metadata": {
        "aggregates": [
          {
            "fields": [
    
  5. Replace the label and name according to your requirements. For example, Collections Summary for Carole White.
    "groupBy": [
              "AccountId"
            ],
            "label": "Collections Summary for Carole White",
            "name": "Collections_Summary_For_Carole_White",
            "sourceName": "Collection_Plan_Filter"
          }  
    
  6. Make sure that the field aliases for the custom sourceFieldNames in the Data Processing Engine definition match those listed in the table. If you've created custom fields with different API names, update the corresponding field aliases accordingly.
    SourceFieldName Alias
    DaysPastDue AccountAverageDaysPastDue
    CurrentDueAmount AccountTotalCurrentDueAmount
    InitialDueAmount AccountTotalInitialDueAmount
    TotalPaymentsReceived AccountTotalPaymentsReceived
    {
      "FullName": "Account Collections Summary","AccountCollectionsSummaryCloned",
      "Metadata": {
        "aggregates": [
          {
            "fields": [
              {
                "aggregateFunction": "Avg",
                "alias": "AccountAverageDaysPastDue",
                "sourceFieldName": "DaysPastDue"
              },
              {
                "aggregateFunction": "Sum",
                "alias": "AccountTotalCurrentDueAmount",
                "sourceFieldName": "CurrentDueAmount"
              },
              {
                "aggregateFunction": "Sum",
                "alias": "AccountTotalInitialDueAmount",
                "sourceFieldName": "InitialDueAmount"
              },
              {
                "aggregateFunction": "Sum",
                "alias": "AccountTotalPaymentsReceived",
                "sourceFieldName": "TotalPaymentsReceived"
              }
            ],
            "groupBy": [
              "AccountId"
            ],
    
  7. Set isTemplate to False.
    "isTemplate": false,
        "label": "Account Collections Summary","Account Collections Summary Cloned"
        "parameters": [
          {
            "dataType": "Text",
            "isMultiValue": false,
            "label": "Input Record Id",
            "name": "Input_Record_Id"
          }
    
  8. Make sure that definitionRunMode is set to OnDemand.
    "definitionRunMode": "OnDemand",
        "description": "Adds quote line items from a CSV file to a quote.",
        "doesGenAllFailedRecords": false,
        "executionPlatformObjectType": "None",
        "executionPlatformType": "CORE",
    
  9. Set writebackUser to a user ID who plans to run this cloned Data Processing Engine definition. Make sure that this user has create, read, update, delete permissions on the Collection Plan and Account objects.
     "isChangedRow": false,
            "isExistingDataset": false,
            "label": "Collection Plan Writeback",
            "name": "Collection_Plan_Writeback",
            "operationType": "Update",
            "shouldCreateTargetObject": false,
            "sourceName": "Collection_Plan_Aggregate",
            "storageType": "sObject",
            "targetObjectName": "Account",
            "writebackRecordMaxLimit": 0,
            "writebackSequence": 1,
            "writebackUser": "<User ID who runs this cloned definition>"
    
  10. Run the API endpoint and provide the content of the cloned and customized Data Processing Engine definition in JSON format as the payload.
    /services/data/v65.0/tooling/sobjects/BatchCalcJobDefinition
  11. From the API endpoint's response, note the record ID of the cloned and customized Data Processing Engine definition.
  12. From Setup, in the Quick Find box, enter Data Processing Engine, and then select Data Processing Engine.
  13. Make sure that the cloned and customized Data Processing Engine is listed.