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

UNAVAILABLE_RECORDTYPE_EXCEPTION, Unable to find default record type

Hi All,


Now,am working on web-to-lead using custom controller.I have written a workflow to send a email alert.When I give the inputs for required fields and submit it. Lead info is not stored in Lead object and in debug log , i have seen the following exception,

System.DmlException: Insert failed. First exception on row 0; first error: UNAVAILABLE_RECORDTYPE_EXCEPTION, Unable to find default record type


I have set the default record type for Lead.But Lead is not stored.


Whenever I deactivated the workflow, it works fine and there is no exception arises .Please guide me to clear this one.


Thanks in advance.




Did you check if you have the company field value filled. The company must have a value on the lead record. 






I tried it.But, it results same exception.


Hi , 


Did you check the profile permissions, if it has convert lead check box checked and ability to create contacts, accounts , and opportunities. 





@vin_dev Did ypou get a solution to your issue?
@ForceCom, my User profiles have a permission set to cerate Opportunity (Accounts & Contacts need not be created). Still getting this error.
@KalyanG You'll need to go to Setup -> Manager Users -> Profiles, then select your profile type. From there, scroll all the way down to the Record Type Settings section and under the Standard Record Type Settings sub-section, Go to the Leads field and ensure that there are values there. If not, you'll need to click Edit and assign a default. This default will need to be the same as the System Admin.