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
HNT_NeoHNT_Neo 

Update Company field with First and Last Name on Lead on creation

I was wondering, upon creating a Lead record, I'd like the Company field to autopopulate the Lead's First Name and Last Name values, when these variables are true: 

Lead Status = New
Lead Record Type ID = 0126A000000LcZz

I tried creating a workflow rule and tried process builder but the Company field did not autopopulate. 

So, I"m guessing the next option is to create this process with Apex. 

Does this sound about right? 

Thanks!
SFDC EvangelistSFDC Evangelist
Hi JH,

You can write Trigger on Account object; which will query Lead Object (Lead.ConvertedAccountId, isconverted = true) with the current AccountId to find out if its an Account converted from a Lead. If it is converted from Lead; you have to update the Account data with Lead First Name and Last Name.

Thanks!
Maharajan CMaharajan C
Hi JH,

Apex also wont allow you to update the Lead Company field.

Because before the Trigger will fire, the standard validation fired that is the Company field is requierd in the Layout to save the Lead.

So the Options are available(try the below things with Google):
- You have to override the standard new button to prepopulate the fields in Lead.
-Or you have to use the Custom visualforce Page to get the Leads.

Can you please Let me know if it helps or not!!!

If it helps don't forget to mark this as a best answer!!!

Thanks,
​Raj