How to load recordTypes using dataLoader based on their names and Not their Ids?












1















I am trying to load some (FinServ__ReciprocalRole__c) data using dataLaoder.
This data should be imported to many environments (sandboxes and scratch orgs).
Given that the RecordType ID is not the same in the various sandboxes and sratch orgs, i want to use the RecordType name instead of the ID as it's consistent across all environments.



Here is an example of a record that i am trying to import:



FinServ__CreateInverseRole__c, Name,   FinServ__InverseRole__c, RecordType.Name
"FALSE", "TEST", "INVERSE TEST", "Contact Role"


No data was imported and i a got this error message:




RecordType ID: id value of incorrect type: Contact Role




Note: I've already checked the accessibility of the record types in my profile.



Did any one encounter this kind of issue by any chance ? thanks for your help.










share|improve this question

























  • Did you enable Bulk API mode?

    – sfdcfox
    Feb 12 at 16:16











  • @sfdcfox No, i did not enable Bulk API

    – Merabti Ibrahim
    Feb 12 at 16:18











  • Try using the Bulk API mode in settings...

    – sfdcfox
    Feb 12 at 16:36











  • with the same file ? ,i mean with this "RecordType.Name" as a header ?

    – Merabti Ibrahim
    Feb 12 at 16:38











  • Yes, the Bulk API mode should support that syntax.

    – sfdcfox
    Feb 12 at 17:12
















1















I am trying to load some (FinServ__ReciprocalRole__c) data using dataLaoder.
This data should be imported to many environments (sandboxes and scratch orgs).
Given that the RecordType ID is not the same in the various sandboxes and sratch orgs, i want to use the RecordType name instead of the ID as it's consistent across all environments.



Here is an example of a record that i am trying to import:



FinServ__CreateInverseRole__c, Name,   FinServ__InverseRole__c, RecordType.Name
"FALSE", "TEST", "INVERSE TEST", "Contact Role"


No data was imported and i a got this error message:




RecordType ID: id value of incorrect type: Contact Role




Note: I've already checked the accessibility of the record types in my profile.



Did any one encounter this kind of issue by any chance ? thanks for your help.










share|improve this question

























  • Did you enable Bulk API mode?

    – sfdcfox
    Feb 12 at 16:16











  • @sfdcfox No, i did not enable Bulk API

    – Merabti Ibrahim
    Feb 12 at 16:18











  • Try using the Bulk API mode in settings...

    – sfdcfox
    Feb 12 at 16:36











  • with the same file ? ,i mean with this "RecordType.Name" as a header ?

    – Merabti Ibrahim
    Feb 12 at 16:38











  • Yes, the Bulk API mode should support that syntax.

    – sfdcfox
    Feb 12 at 17:12














1












1








1








I am trying to load some (FinServ__ReciprocalRole__c) data using dataLaoder.
This data should be imported to many environments (sandboxes and scratch orgs).
Given that the RecordType ID is not the same in the various sandboxes and sratch orgs, i want to use the RecordType name instead of the ID as it's consistent across all environments.



Here is an example of a record that i am trying to import:



FinServ__CreateInverseRole__c, Name,   FinServ__InverseRole__c, RecordType.Name
"FALSE", "TEST", "INVERSE TEST", "Contact Role"


No data was imported and i a got this error message:




RecordType ID: id value of incorrect type: Contact Role




Note: I've already checked the accessibility of the record types in my profile.



Did any one encounter this kind of issue by any chance ? thanks for your help.










share|improve this question
















I am trying to load some (FinServ__ReciprocalRole__c) data using dataLaoder.
This data should be imported to many environments (sandboxes and scratch orgs).
Given that the RecordType ID is not the same in the various sandboxes and sratch orgs, i want to use the RecordType name instead of the ID as it's consistent across all environments.



Here is an example of a record that i am trying to import:



FinServ__CreateInverseRole__c, Name,   FinServ__InverseRole__c, RecordType.Name
"FALSE", "TEST", "INVERSE TEST", "Contact Role"


No data was imported and i a got this error message:




RecordType ID: id value of incorrect type: Contact Role




Note: I've already checked the accessibility of the record types in my profile.



Did any one encounter this kind of issue by any chance ? thanks for your help.







data-loader record-type






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 12 at 15:01









Jayant Das

14.8k2824




14.8k2824










asked Feb 12 at 14:49









Merabti IbrahimMerabti Ibrahim

371417




371417













  • Did you enable Bulk API mode?

    – sfdcfox
    Feb 12 at 16:16











  • @sfdcfox No, i did not enable Bulk API

    – Merabti Ibrahim
    Feb 12 at 16:18











  • Try using the Bulk API mode in settings...

    – sfdcfox
    Feb 12 at 16:36











  • with the same file ? ,i mean with this "RecordType.Name" as a header ?

    – Merabti Ibrahim
    Feb 12 at 16:38











  • Yes, the Bulk API mode should support that syntax.

    – sfdcfox
    Feb 12 at 17:12



















  • Did you enable Bulk API mode?

    – sfdcfox
    Feb 12 at 16:16











  • @sfdcfox No, i did not enable Bulk API

    – Merabti Ibrahim
    Feb 12 at 16:18











  • Try using the Bulk API mode in settings...

    – sfdcfox
    Feb 12 at 16:36











  • with the same file ? ,i mean with this "RecordType.Name" as a header ?

    – Merabti Ibrahim
    Feb 12 at 16:38











  • Yes, the Bulk API mode should support that syntax.

    – sfdcfox
    Feb 12 at 17:12

















Did you enable Bulk API mode?

– sfdcfox
Feb 12 at 16:16





Did you enable Bulk API mode?

– sfdcfox
Feb 12 at 16:16













@sfdcfox No, i did not enable Bulk API

– Merabti Ibrahim
Feb 12 at 16:18





@sfdcfox No, i did not enable Bulk API

– Merabti Ibrahim
Feb 12 at 16:18













Try using the Bulk API mode in settings...

– sfdcfox
Feb 12 at 16:36





Try using the Bulk API mode in settings...

– sfdcfox
Feb 12 at 16:36













with the same file ? ,i mean with this "RecordType.Name" as a header ?

– Merabti Ibrahim
Feb 12 at 16:38





with the same file ? ,i mean with this "RecordType.Name" as a header ?

– Merabti Ibrahim
Feb 12 at 16:38













Yes, the Bulk API mode should support that syntax.

– sfdcfox
Feb 12 at 17:12





Yes, the Bulk API mode should support that syntax.

– sfdcfox
Feb 12 at 17:12










3 Answers
3






active

oldest

votes


















3














FRAME CHALLENGE



For one-time imports from a CLI to use in multiple orgs (including scratch orgs), you should be using sfdx. This allows you to write a shell script/batch file that allows you to make a portable upload:



sfdx force:data:bulk:upsert -s FinServ__ReciprocalRole__c -f file/to/import.csv -i Id -w 10


Using the Bulk API allows you to specify references, as outlined in Relationship Fields in a Header Row.



The Data Loader is not purpose-built for migrating data between orgs (thus manual mapping in Excel/external apps is often required), so it lacks many of the features that are found in SFDX and newer tools.






share|improve this answer
























  • Yep, this works. Didn't think it this way. But I will still think as long as its a data load activity, and that you need to utilize say data loader, still stick with RecordTypeId to reduce any complexity.

    – Jayant Das
    Feb 12 at 18:39











  • I keep getting this error message "DUPLICATE_EXTERNAL_ID:Name: more than one record found for external id field" when i try to execute the command line above. i have no data in my scratch so, it's kind of strange to have this error. I noticed though that when get rid of "RecordType.Name" column , it works and this errors disappears. SO, if this worked for you ,i must have missed something

    – Merabti Ibrahim
    Feb 13 at 13:55






  • 1





    @MerabtiIbrahim Name needs to be unique. For example, if you have two record types named "Household" on two separate objects, this could cause this error. You'll need to have unique record type names for this to work.

    – sfdcfox
    Feb 13 at 14:17











  • @sfdcfox,so you want to say that there is another record type with the same name on another object ?

    – Merabti Ibrahim
    Feb 13 at 14:21






  • 1





    @MerabtiIbrahim That's the usual case, yes. I don't know why it does this, but that's how it behaves.

    – sfdcfox
    Feb 13 at 14:28



















2














I know one way you can use. You have to use a custom field and a trigger.




  1. Create a text field on FinServ__ReciprocalRole__c named as RecordTypeTemp__c


  2. Write a before insert trigger on FinServ__ReciprocalRole__c to map RecordTypeTemp__c into RecordType Id



    Trigger ReciprocalRoleTrigger on FinServ__ReciprocalRole__c (before insert){

    Map<String , Schema.RecordTypeInfo> reciprocalNameRecordTypeMap = FinServ__ReciprocalRole__c.SObjectType.getDescribe().recordTypeInfosByDeveloperName;


    for(FinServ__ReciprocalRole__c ind : Trigger.new){
    ind.RecordTypeId = reciprocalNameRecordTypeMap.get(ind.RecordTypeTemp__c).recordTypeId;
    }
    }



Now when you load data, dont populate recordTypeId field just populate RecordTypeTemp__c with the developer name to make a consistent behaviour in dataload accross all orgs






share|improve this answer



















  • 1





    This will definitely work, but personally I wouldn't recommend building any customization to address a data loading activity.

    – Jayant Das
    Feb 12 at 15:52






  • 1





    @JayantDas I second that.4

    – Pranay Jaiswal
    Feb 12 at 15:53



















1














You cannot use Record Type Name in data loader to map to a particular record type. You will need to use RecordTypeId for this purpose.



As a reference, it is mentioned in this knowledge article:




Changing record types for multiple records via the dataloader is not as straight forward as it would seem. Instead of using the record type name, usage of the record type ID gathered via the URL is required.







share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "459"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f250018%2fhow-to-load-recordtypes-using-dataloader-based-on-their-names-and-not-their-ids%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    FRAME CHALLENGE



    For one-time imports from a CLI to use in multiple orgs (including scratch orgs), you should be using sfdx. This allows you to write a shell script/batch file that allows you to make a portable upload:



    sfdx force:data:bulk:upsert -s FinServ__ReciprocalRole__c -f file/to/import.csv -i Id -w 10


    Using the Bulk API allows you to specify references, as outlined in Relationship Fields in a Header Row.



    The Data Loader is not purpose-built for migrating data between orgs (thus manual mapping in Excel/external apps is often required), so it lacks many of the features that are found in SFDX and newer tools.






    share|improve this answer
























    • Yep, this works. Didn't think it this way. But I will still think as long as its a data load activity, and that you need to utilize say data loader, still stick with RecordTypeId to reduce any complexity.

      – Jayant Das
      Feb 12 at 18:39











    • I keep getting this error message "DUPLICATE_EXTERNAL_ID:Name: more than one record found for external id field" when i try to execute the command line above. i have no data in my scratch so, it's kind of strange to have this error. I noticed though that when get rid of "RecordType.Name" column , it works and this errors disappears. SO, if this worked for you ,i must have missed something

      – Merabti Ibrahim
      Feb 13 at 13:55






    • 1





      @MerabtiIbrahim Name needs to be unique. For example, if you have two record types named "Household" on two separate objects, this could cause this error. You'll need to have unique record type names for this to work.

      – sfdcfox
      Feb 13 at 14:17











    • @sfdcfox,so you want to say that there is another record type with the same name on another object ?

      – Merabti Ibrahim
      Feb 13 at 14:21






    • 1





      @MerabtiIbrahim That's the usual case, yes. I don't know why it does this, but that's how it behaves.

      – sfdcfox
      Feb 13 at 14:28
















    3














    FRAME CHALLENGE



    For one-time imports from a CLI to use in multiple orgs (including scratch orgs), you should be using sfdx. This allows you to write a shell script/batch file that allows you to make a portable upload:



    sfdx force:data:bulk:upsert -s FinServ__ReciprocalRole__c -f file/to/import.csv -i Id -w 10


    Using the Bulk API allows you to specify references, as outlined in Relationship Fields in a Header Row.



    The Data Loader is not purpose-built for migrating data between orgs (thus manual mapping in Excel/external apps is often required), so it lacks many of the features that are found in SFDX and newer tools.






    share|improve this answer
























    • Yep, this works. Didn't think it this way. But I will still think as long as its a data load activity, and that you need to utilize say data loader, still stick with RecordTypeId to reduce any complexity.

      – Jayant Das
      Feb 12 at 18:39











    • I keep getting this error message "DUPLICATE_EXTERNAL_ID:Name: more than one record found for external id field" when i try to execute the command line above. i have no data in my scratch so, it's kind of strange to have this error. I noticed though that when get rid of "RecordType.Name" column , it works and this errors disappears. SO, if this worked for you ,i must have missed something

      – Merabti Ibrahim
      Feb 13 at 13:55






    • 1





      @MerabtiIbrahim Name needs to be unique. For example, if you have two record types named "Household" on two separate objects, this could cause this error. You'll need to have unique record type names for this to work.

      – sfdcfox
      Feb 13 at 14:17











    • @sfdcfox,so you want to say that there is another record type with the same name on another object ?

      – Merabti Ibrahim
      Feb 13 at 14:21






    • 1





      @MerabtiIbrahim That's the usual case, yes. I don't know why it does this, but that's how it behaves.

      – sfdcfox
      Feb 13 at 14:28














    3












    3








    3







    FRAME CHALLENGE



    For one-time imports from a CLI to use in multiple orgs (including scratch orgs), you should be using sfdx. This allows you to write a shell script/batch file that allows you to make a portable upload:



    sfdx force:data:bulk:upsert -s FinServ__ReciprocalRole__c -f file/to/import.csv -i Id -w 10


    Using the Bulk API allows you to specify references, as outlined in Relationship Fields in a Header Row.



    The Data Loader is not purpose-built for migrating data between orgs (thus manual mapping in Excel/external apps is often required), so it lacks many of the features that are found in SFDX and newer tools.






    share|improve this answer













    FRAME CHALLENGE



    For one-time imports from a CLI to use in multiple orgs (including scratch orgs), you should be using sfdx. This allows you to write a shell script/batch file that allows you to make a portable upload:



    sfdx force:data:bulk:upsert -s FinServ__ReciprocalRole__c -f file/to/import.csv -i Id -w 10


    Using the Bulk API allows you to specify references, as outlined in Relationship Fields in a Header Row.



    The Data Loader is not purpose-built for migrating data between orgs (thus manual mapping in Excel/external apps is often required), so it lacks many of the features that are found in SFDX and newer tools.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Feb 12 at 18:22









    sfdcfoxsfdcfox

    256k11201441




    256k11201441













    • Yep, this works. Didn't think it this way. But I will still think as long as its a data load activity, and that you need to utilize say data loader, still stick with RecordTypeId to reduce any complexity.

      – Jayant Das
      Feb 12 at 18:39











    • I keep getting this error message "DUPLICATE_EXTERNAL_ID:Name: more than one record found for external id field" when i try to execute the command line above. i have no data in my scratch so, it's kind of strange to have this error. I noticed though that when get rid of "RecordType.Name" column , it works and this errors disappears. SO, if this worked for you ,i must have missed something

      – Merabti Ibrahim
      Feb 13 at 13:55






    • 1





      @MerabtiIbrahim Name needs to be unique. For example, if you have two record types named "Household" on two separate objects, this could cause this error. You'll need to have unique record type names for this to work.

      – sfdcfox
      Feb 13 at 14:17











    • @sfdcfox,so you want to say that there is another record type with the same name on another object ?

      – Merabti Ibrahim
      Feb 13 at 14:21






    • 1





      @MerabtiIbrahim That's the usual case, yes. I don't know why it does this, but that's how it behaves.

      – sfdcfox
      Feb 13 at 14:28



















    • Yep, this works. Didn't think it this way. But I will still think as long as its a data load activity, and that you need to utilize say data loader, still stick with RecordTypeId to reduce any complexity.

      – Jayant Das
      Feb 12 at 18:39











    • I keep getting this error message "DUPLICATE_EXTERNAL_ID:Name: more than one record found for external id field" when i try to execute the command line above. i have no data in my scratch so, it's kind of strange to have this error. I noticed though that when get rid of "RecordType.Name" column , it works and this errors disappears. SO, if this worked for you ,i must have missed something

      – Merabti Ibrahim
      Feb 13 at 13:55






    • 1





      @MerabtiIbrahim Name needs to be unique. For example, if you have two record types named "Household" on two separate objects, this could cause this error. You'll need to have unique record type names for this to work.

      – sfdcfox
      Feb 13 at 14:17











    • @sfdcfox,so you want to say that there is another record type with the same name on another object ?

      – Merabti Ibrahim
      Feb 13 at 14:21






    • 1





      @MerabtiIbrahim That's the usual case, yes. I don't know why it does this, but that's how it behaves.

      – sfdcfox
      Feb 13 at 14:28

















    Yep, this works. Didn't think it this way. But I will still think as long as its a data load activity, and that you need to utilize say data loader, still stick with RecordTypeId to reduce any complexity.

    – Jayant Das
    Feb 12 at 18:39





    Yep, this works. Didn't think it this way. But I will still think as long as its a data load activity, and that you need to utilize say data loader, still stick with RecordTypeId to reduce any complexity.

    – Jayant Das
    Feb 12 at 18:39













    I keep getting this error message "DUPLICATE_EXTERNAL_ID:Name: more than one record found for external id field" when i try to execute the command line above. i have no data in my scratch so, it's kind of strange to have this error. I noticed though that when get rid of "RecordType.Name" column , it works and this errors disappears. SO, if this worked for you ,i must have missed something

    – Merabti Ibrahim
    Feb 13 at 13:55





    I keep getting this error message "DUPLICATE_EXTERNAL_ID:Name: more than one record found for external id field" when i try to execute the command line above. i have no data in my scratch so, it's kind of strange to have this error. I noticed though that when get rid of "RecordType.Name" column , it works and this errors disappears. SO, if this worked for you ,i must have missed something

    – Merabti Ibrahim
    Feb 13 at 13:55




    1




    1





    @MerabtiIbrahim Name needs to be unique. For example, if you have two record types named "Household" on two separate objects, this could cause this error. You'll need to have unique record type names for this to work.

    – sfdcfox
    Feb 13 at 14:17





    @MerabtiIbrahim Name needs to be unique. For example, if you have two record types named "Household" on two separate objects, this could cause this error. You'll need to have unique record type names for this to work.

    – sfdcfox
    Feb 13 at 14:17













    @sfdcfox,so you want to say that there is another record type with the same name on another object ?

    – Merabti Ibrahim
    Feb 13 at 14:21





    @sfdcfox,so you want to say that there is another record type with the same name on another object ?

    – Merabti Ibrahim
    Feb 13 at 14:21




    1




    1





    @MerabtiIbrahim That's the usual case, yes. I don't know why it does this, but that's how it behaves.

    – sfdcfox
    Feb 13 at 14:28





    @MerabtiIbrahim That's the usual case, yes. I don't know why it does this, but that's how it behaves.

    – sfdcfox
    Feb 13 at 14:28













    2














    I know one way you can use. You have to use a custom field and a trigger.




    1. Create a text field on FinServ__ReciprocalRole__c named as RecordTypeTemp__c


    2. Write a before insert trigger on FinServ__ReciprocalRole__c to map RecordTypeTemp__c into RecordType Id



      Trigger ReciprocalRoleTrigger on FinServ__ReciprocalRole__c (before insert){

      Map<String , Schema.RecordTypeInfo> reciprocalNameRecordTypeMap = FinServ__ReciprocalRole__c.SObjectType.getDescribe().recordTypeInfosByDeveloperName;


      for(FinServ__ReciprocalRole__c ind : Trigger.new){
      ind.RecordTypeId = reciprocalNameRecordTypeMap.get(ind.RecordTypeTemp__c).recordTypeId;
      }
      }



    Now when you load data, dont populate recordTypeId field just populate RecordTypeTemp__c with the developer name to make a consistent behaviour in dataload accross all orgs






    share|improve this answer



















    • 1





      This will definitely work, but personally I wouldn't recommend building any customization to address a data loading activity.

      – Jayant Das
      Feb 12 at 15:52






    • 1





      @JayantDas I second that.4

      – Pranay Jaiswal
      Feb 12 at 15:53
















    2














    I know one way you can use. You have to use a custom field and a trigger.




    1. Create a text field on FinServ__ReciprocalRole__c named as RecordTypeTemp__c


    2. Write a before insert trigger on FinServ__ReciprocalRole__c to map RecordTypeTemp__c into RecordType Id



      Trigger ReciprocalRoleTrigger on FinServ__ReciprocalRole__c (before insert){

      Map<String , Schema.RecordTypeInfo> reciprocalNameRecordTypeMap = FinServ__ReciprocalRole__c.SObjectType.getDescribe().recordTypeInfosByDeveloperName;


      for(FinServ__ReciprocalRole__c ind : Trigger.new){
      ind.RecordTypeId = reciprocalNameRecordTypeMap.get(ind.RecordTypeTemp__c).recordTypeId;
      }
      }



    Now when you load data, dont populate recordTypeId field just populate RecordTypeTemp__c with the developer name to make a consistent behaviour in dataload accross all orgs






    share|improve this answer



















    • 1





      This will definitely work, but personally I wouldn't recommend building any customization to address a data loading activity.

      – Jayant Das
      Feb 12 at 15:52






    • 1





      @JayantDas I second that.4

      – Pranay Jaiswal
      Feb 12 at 15:53














    2












    2








    2







    I know one way you can use. You have to use a custom field and a trigger.




    1. Create a text field on FinServ__ReciprocalRole__c named as RecordTypeTemp__c


    2. Write a before insert trigger on FinServ__ReciprocalRole__c to map RecordTypeTemp__c into RecordType Id



      Trigger ReciprocalRoleTrigger on FinServ__ReciprocalRole__c (before insert){

      Map<String , Schema.RecordTypeInfo> reciprocalNameRecordTypeMap = FinServ__ReciprocalRole__c.SObjectType.getDescribe().recordTypeInfosByDeveloperName;


      for(FinServ__ReciprocalRole__c ind : Trigger.new){
      ind.RecordTypeId = reciprocalNameRecordTypeMap.get(ind.RecordTypeTemp__c).recordTypeId;
      }
      }



    Now when you load data, dont populate recordTypeId field just populate RecordTypeTemp__c with the developer name to make a consistent behaviour in dataload accross all orgs






    share|improve this answer













    I know one way you can use. You have to use a custom field and a trigger.




    1. Create a text field on FinServ__ReciprocalRole__c named as RecordTypeTemp__c


    2. Write a before insert trigger on FinServ__ReciprocalRole__c to map RecordTypeTemp__c into RecordType Id



      Trigger ReciprocalRoleTrigger on FinServ__ReciprocalRole__c (before insert){

      Map<String , Schema.RecordTypeInfo> reciprocalNameRecordTypeMap = FinServ__ReciprocalRole__c.SObjectType.getDescribe().recordTypeInfosByDeveloperName;


      for(FinServ__ReciprocalRole__c ind : Trigger.new){
      ind.RecordTypeId = reciprocalNameRecordTypeMap.get(ind.RecordTypeTemp__c).recordTypeId;
      }
      }



    Now when you load data, dont populate recordTypeId field just populate RecordTypeTemp__c with the developer name to make a consistent behaviour in dataload accross all orgs







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Feb 12 at 15:15









    Pranay JaiswalPranay Jaiswal

    16.5k32755




    16.5k32755








    • 1





      This will definitely work, but personally I wouldn't recommend building any customization to address a data loading activity.

      – Jayant Das
      Feb 12 at 15:52






    • 1





      @JayantDas I second that.4

      – Pranay Jaiswal
      Feb 12 at 15:53














    • 1





      This will definitely work, but personally I wouldn't recommend building any customization to address a data loading activity.

      – Jayant Das
      Feb 12 at 15:52






    • 1





      @JayantDas I second that.4

      – Pranay Jaiswal
      Feb 12 at 15:53








    1




    1





    This will definitely work, but personally I wouldn't recommend building any customization to address a data loading activity.

    – Jayant Das
    Feb 12 at 15:52





    This will definitely work, but personally I wouldn't recommend building any customization to address a data loading activity.

    – Jayant Das
    Feb 12 at 15:52




    1




    1





    @JayantDas I second that.4

    – Pranay Jaiswal
    Feb 12 at 15:53





    @JayantDas I second that.4

    – Pranay Jaiswal
    Feb 12 at 15:53











    1














    You cannot use Record Type Name in data loader to map to a particular record type. You will need to use RecordTypeId for this purpose.



    As a reference, it is mentioned in this knowledge article:




    Changing record types for multiple records via the dataloader is not as straight forward as it would seem. Instead of using the record type name, usage of the record type ID gathered via the URL is required.







    share|improve this answer




























      1














      You cannot use Record Type Name in data loader to map to a particular record type. You will need to use RecordTypeId for this purpose.



      As a reference, it is mentioned in this knowledge article:




      Changing record types for multiple records via the dataloader is not as straight forward as it would seem. Instead of using the record type name, usage of the record type ID gathered via the URL is required.







      share|improve this answer


























        1












        1








        1







        You cannot use Record Type Name in data loader to map to a particular record type. You will need to use RecordTypeId for this purpose.



        As a reference, it is mentioned in this knowledge article:




        Changing record types for multiple records via the dataloader is not as straight forward as it would seem. Instead of using the record type name, usage of the record type ID gathered via the URL is required.







        share|improve this answer













        You cannot use Record Type Name in data loader to map to a particular record type. You will need to use RecordTypeId for this purpose.



        As a reference, it is mentioned in this knowledge article:




        Changing record types for multiple records via the dataloader is not as straight forward as it would seem. Instead of using the record type name, usage of the record type ID gathered via the URL is required.








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 12 at 14:59









        Jayant DasJayant Das

        14.8k2824




        14.8k2824






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Salesforce Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f250018%2fhow-to-load-recordtypes-using-dataloader-based-on-their-names-and-not-their-ids%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

            How to change which sound is reproduced for terminal bell?

            Can I use Tabulator js library in my java Spring + Thymeleaf project?