How to limit number of Parent Records?

Question.

I am having some trouble limiting the number of parent records inserted into a new org with a limited number of child records.

{
   objects: [
     {
         "query": "SELECT Id FROM Object_A__c",
         ....
     },
     {
          "query": "SELECT Id, Object_A__c FROM Object_B__c LIMIT 10",
          ....
     }
   ]
}

How do I limit the imported Object_A__c records to only the parents of the 10 selected Object_B__c records?

Right now, all Object_A__c records are being imported.

Answer.

The dependent records selection is controlled the using "master: true/false" parameter.

Set Object_A__c to master: false:

{
 objects: [
 {
 "query": "SELECT Id FROM Object_A__c",
 "master" : false,
 ....
 },
 {
 "query": "SELECT Id, Object_A__c FROM Object_B__c LIMIT 10",
 ....
 }
 ]
}
Last updated on Sa Oct 2022