Can i assign a owner for a web to lead form in the website code? Just like we do for the record type and Lead Source.

1) Record Type <input type=hidden name="recordType" id="recordType" value="RECORDID">

2) <input type=hidden name=“LeadSource” value=“Lead Reg”>

3) <input type=hidden name=“OwnerID” value=“XXXXXXXXXX”>

Please let me know your thoughts? Or using assignment rules is the best.

2 Answers 2


Yes, you can but you need custom field and Trigger. You can create a custom field (let's say Lead_OwnerId__c ) and pass user Id from the form in hidden field and write a trigger to assign lead's OwnerId to the value in this custom field.

To pass value to custom field you need to get Id of the field (it starts with "00N" and you can get it from the URL when you open it just like any other Id in salesforce). So your input hidden will look something like this:

<input type="hidden" id="00NU0000005gZCB" name="00NU0000005gZCB" value="user_id"/>

Where 00NU0000005gZCB - id of the custom field.


Owner cannot be set by the form. Use assignment rules or the Default Lead Owner setting in the Web-to-Lead configuration.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .