0

I am using SFDMU tool (Salesforce Data Loader SFDX Plugin) to upload csv data files to a target salesforce org. I have 3 records A, B and C in an object in a hierarchy. Record B is in a self-lookup with Record A and Record C is in a self-lookup with Record B. The recordTypeId in the source csvfile is different from the target org recordTypeIds and hence is not getting uploaded in the target org by SFDMU tool. The self-lookup in hierarchical object is failing with error- Value does not exist or does not match filter criteria (This is because records are not getting uploaded with recordTypeId). Is there any way to make the recordTypeid generic or use recordTypeName instead of ID so SFDMU can map it properly?

The problem I have to work out is how to insert csv file records using SFDMU tool when recordTypeId is different in csv file and the target org I am trying to populate

SFDMU tool: https://github.com/forcedotcom/SFDX-Data-Move-Utility

5
  • A note on terminology. A "self-lookup" would mean that you have a lookup relationship field on one object that points to a record of the same object. E.g. from Object A to Object A, or from Account to Account (i.e. the standard ParentId field).
    – Derek F
    Jan 3, 2022 at 12:37
  • Apologies. You are correct. So there is 1 object. There are 3 records/rows in the CSV file for this specic object. The 2nd record is doing a lookup of the first record, and the 3rd record is doing lookup of the second record. Jan 3, 2022 at 14:02
  • What does RecordTypeId have to do with the lookup field? It sounds like you have two different issues. Please edit your post to include more detail. Jan 3, 2022 at 16:33
  • @DavidCheng The error message suggests that it's a lookup filter gumming up the works.
    – Derek F
    Jan 3, 2022 at 16:42
  • @DavidCheng Hi David, the lookup error is coming because when I am making a data entry of the records, the column of recordTypeId is getting skipped. SInce the data entry of Record A is not proper, it is not able to perform a self-lookup. That is my understanding of the problem. I have edited the post to make it clearer. Thank you! Jan 4, 2022 at 4:59

1 Answer 1

0

You'll want to take a look at Handling of the RecordType

Based on your description, it sounds like the following is true:

  • Relevant already record types exist in both orgs
  • Record Type Ids do not match in both orgs (created at different times, not refreshed from same source)

Hence, the tool trying to insert accounts and utilize the record type Id pulled would error since those Ids are not valid in the target.

In that case, you'll want to specify RecordType as an object in your .json file and use the externalId as DeveloperName to allow it to match to the target record types that already exist

 objects: [
      .....
      {         
          "query": "SELECT DeveloperName FROM RecordType WHERE IsActive = true",
          "externalId" : "DeveloperName;NamespacePrefix;SobjectType"
      }
       .....
  ]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .