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
Dhanik Lal SahniDhanik Lal Sahni 

Update Account.Name field when FirstName or LastName will be changed

I want to update Account.Name with ( FirstName__C + LastName__C) whenever FirstName__C or LastName__C is changed or new account is created.

Workflow/process builder/trigger will not work as it will work when event is raised and Account.Name is mandatory field. Any suggestion. 
Best Answer chosen by Dhanik Lal Sahni
Vidol ChalamovVidol Chalamov
The best I can think of is Custom VisualForce page that overrides default Create page. In that VF page, you can show as many fields as you like and then on submitting the form an Apex controller will process the request and create an Account with the desired Name.

All Answers

Vidol ChalamovVidol Chalamov
The best I can think of is Custom VisualForce page that overrides default Create page. In that VF page, you can show as many fields as you like and then on submitting the form an Apex controller will process the request and create an Account with the desired Name.
This was selected as the best answer
Pankaj PPankaj P
I think Vidol's response mentioned above is the only option to do it but having all fields on that VF page may give you problem in long run when everytime your end user adds new fields, you need to change code to add those new fields to that VF page OR your controller and VF page code should be smart to use Dynamic apex and fetching all fields.

I think best option can be using a VF page and overiding the New button for Account and just ask for First Name and Last Name for that Account to that user and insert Account there itself by concating for Account.Name field and redirect user to edit layout of that account using url.
And further if you want on update of First Name and Last Name use process builder for update case.

Hope this helps you.
Thanks,
Pankaj.