function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NMackeyNMackey 

Set RecordType by name via Data Loader

Is it possible to set the RecordType field for an object by name via the data loader?

 

At present, I just obtain a copy of the RecordType IDs and use a VLOOKUP in Excel to map them prior to import which might end up being a problem for end users.

 

I was thinking of having an additional custom field that gets updated with the record type name via a trigger prior to inset and update. That's another SOQL query though, and while I'm not close to hitting governer limits now, that may change in the future as we add functionality.

 

If the answer to my question below is negative, which is my suggested solutions should I go for?

David81David81

Could you use a Workflow Rule + Field Update to set the Record Type? What are your criteria for setting the Record Type?

NMackeyNMackey

I can look into that. I am quite new to Salesforce development so I often forget to think of built in functionality like workflows.

 

The criteria for setting the record type from a user's data entry point of view is the page layout they see if tied to the record type. And in my custom object, there is a formula field that holds the record type name.

 

I have business logic in triggers that creates Apex objects based on the record type.

 

This works well for entering in data via the UI, but falls apart in a bulk import scenario.