Loading

Pass a Record Type through Web-to-Case or Web-to-Lead Form

Data pubblicazione: Jun 25, 2026
Descrizione

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.

Risoluzione

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."

Numero articolo Knowledge

000385236

 
Caricamento
Salesforce Help | Article