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
skunkoniusskunkonius 

Record Type being overridden with user default when creating a lead through the API.

I have experiencing an issue where we are setting the RecordTypeId field when creating a lead.  The lead gets created successfully but the record type is always set to the users default record type.  We have verified that the Record Type Id value we are using is valid, and is available to the user.

 

We were successful in getting the record type set by immediately updating the lead created with the record type id.

 

It seems strange that we can set the record type with the update method, but not the create method.

 

Thanks for any assistance.

Cool_DevloperCool_Devloper

As far as i know, it should not behave like this!!

 

But have'nt encountered this issue yet. Is it happening just with leads or some other object as well?

 

Cool_D

skunkoniusskunkonius
We have only tried it with leads.
Asmit__cAsmit__c
Hello Fellas,

I encountered the same issue where I was creating a lead by using custom apex code based on some external data and found out that 
the default recordtype id was overriding the recordtype id value which i assigned to the record,at the time of insertion.

Found a way out.

Goto Lead Settings -> Edit  -> Select Keep the existing record type
Goto Lead Settings from setup-> edit-> click Keep the existing record Type 
It works fine.
Hope it helps!

Stay Safe,
Asmit