When using Web-to-Case or Web-to-Lead forms, you can designate a specific Salesforce record type for each submitted record. This is done by including a hidden input field in your HTML form that contains the record type ID. This article explains how to configure this and ensure the record type is retained on submission.
How to Pass a Record Type in the Form
To designate a specific record type, add a hidden input field to your HTML form. The field should have the name attribute set to 'recordType' and the value set to the 15-character ID of the desired record type. For example: add an HTML input element with type="hidden", name="recordType", id="recordType", and value equal to the 15-character record type ID.
<input type=hidden name="recordType" id="recordType" value="XXXXXXXXXXXXXXX">
This hidden field will cause Salesforce to automatically assign the specified record type when the record is created, overriding the default record type of the assigned user. It is recommended to use the 15-character record type ID.
Setting the Record Type Assignment Option
To ensure the record type submitted via the form is retained (not overridden by user defaults), configure the record type assignment setting to "Keep the existing record type."
Navigation Path — Salesforce Classic (For Leads)
Go to Setup > Customize > Leads > Lead Settings, and select "Keep the existing record type."
Navigation Path — Lightning Experience (For Leads)
Go to Setup > Feature Settings > Marketing > Lead Settings, and select "Keep the existing record type."
Navigation Path — Salesforce Classic (For Cases)
Go to Setup > Customize > Cases > Support Settings, and select "Keep the existing record type."
Navigation Path — Lightning Experience (For Cases)
Go to Setup > Feature Settings > Service > Support Settings, and select "Keep the existing record type."
000385236

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.