ScriptObjectSet Object.


🡨 Go Back to Export.json File Overview

Table of Contents



ScriptObjectSet Object Overview

The ScriptObjectSet object within the SFDMU's export.json file is a child of the Script object. It is specifically designed to segment a large migration job into smaller, more manageable sub-jobs.

Each ScriptObjectSet can contain a subset of ScriptObjects, which are executed together as a separate sub-job. This organization helps to structure the migration process efficiently, allowing for targeted execution of specific groups of Salesforce objects (sObjects) within the broader migration framework.

For further details on setting up multiple object sets, refer to the Multiple Object Sets documentation.

Usage of ScriptObjectSets

  • Multiple Operations on the Same sObject: ScriptObjectSets are useful for performing various operations on the same sObject across different sets. For example, one might use a set to delete old Accounts and another to insert new Accounts.
  • Sequential Execution: The plugin executes each ScriptObjectSet in the sequence they are listed in the export.json file, ensuring orderly processing.

Configuration Example

Below is an example demonstrating how to use the objectSets property within the Script object to declare multiple ScriptObjectSets:

{
  "objectSets": [
    {
      // Configuration to delete old Accounts and related Opportunities
      "objects": [
        {
          "query": "SELECT Id FROM Account WHERE Name LIKE '%Account To Delete%'",
          "operation": "DeleteHierarchy"
        },
        {
          "query": "SELECT Id, AccountId FROM Opportunity",
          "operation": "DeleteHierarchy",
          "master": false
        }
      ]
    },
    {
      // Configuration to insert new Accounts and related Opportunities
      "objects": [
        {
          "query": "SELECT Id, Name, Phone FROM Account WHERE Name LIKE '%Account To Insert%'",
          "operation": "Insert"
        },
        {
          "query": "SELECT Id, Type, StageName, AccountId FROM Opportunity",
          "operation": "Insert",
          "master": false
        }
      ]
    }
  ]
}

ScriptObjectSet Object Properties

objects (Array of ScriptObject)

Mandatory. This property defines the ScriptObjects within the ScriptObjectSet. Each entry in the array declares one sObject and specifies a particular operation to be applied. This mirrors the objects property of the main Script object.

Example of export.json Configuration:

{
  "objectSets": [
    {     
      "objects": [
        {
          "query": "SELECT Id FROM Account WHERE CreatedDate < LAST_N_YEARS:2",
          "operation": "Delete"
        }
      ]
    }
  // ... other object sets if available  
  ]
  // ... other export.json properties
}
Last updated on 23rd Apr 2024