Skip to main content

We're trying to use data:tree:import. The problem we're having is that we're trying to import records that have a record type. Right now our approach is messy. We have to query the org for a record type, get the ID, and then manually replace all of the references in the data.json files and then we can run our import plan.

 

Is there a way to using just DX commands craft a data plan with records that have a specific record type? Maybe by name?

 

We're trying to get this to work with Health Cloud that ships specific record types we need to leverage.

2 comments
  1. Dec 23, 2024, 3:36 PM

    I noticed the data plan in lwc-recipes supports the concept of saving references and resolving references

     

    The `Account.json` file creates references in the attributes section, like this:

    {

    "Records":[

    {

    "attributes": {

    "type": "Account",

    "referenceId": "AccountRef1"

    },

    "Name": "Alpha Dynamics",

    "Type": "Technology Partner"

    }

    ]

    }

    The `Contacts.json` consumes the references, using an AccountId property assignment like this:

    "AccountId": "@AccountRef1",

    data-plan.json

    [

    {

    "sobject": "Account",

    "saveRefs": true,

    "resolveRefs": false,

    "files": ["Accounts.json"]

    },

    {

    "sobject": "Contact",

    "saveRefs": true,

    "resolveRefs": true,

    "files": ["Contacts.json"]

    }

    ]

    I have not tried this with record types, but will let you know how it goes.

0/9000