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
dnewportdnewport 

S Control to Autopopulate the "Company Field" in Leads

Hi,
I am a programming "ignoramus"....a business user that knows enough to be dangerous...lol.  We have no need for the Company field to be required in "Leads"  The suggestion we got from Tech Support was to create a custom S-Control to autopopulate the "Company" Field with the Lead's First and Last Name.  That would be great....if I knew how to write the s-control.
 
HELP!!!! PLEASE!!!!
Greg HGreg H

The problem with building your sControl is that the trigger for the sControl (the button which will initiate the update of lead information) cannot be placed on the edit screen for your lead.  More specifically, in order for the sControl to update the company field you will need to already have the lead's first and last names populated somewhere.  Since the original lead entry cannot be saved without having the company field populated you'd be better off establishing the process by which these records get entered and mandating that the users enter the company name as the person's first/last names.  Then have managers inspect that the information is being properly added to salesforce.

Technically, you could build an sControl to mimic the lead edit screen and in that way auto-populate the entry of the company name when the information is saved.  However, an sControl of this type might be misleading to your users in that they will still see the standard buttons on the leads tab if they navigate the application.  And if they used the standard "New" button on the leads tab then they would be forced to enter the company name manually anyway.

Just some items to consider prior to building the sControl.
-greg

michaelforcemichaelforce

You could override the "New" button on the lead to direct you to the following URL:

/00Q/e?lea3=Dummy

Where "Dummy" is whatever generic text you want to have put in the Company field (it would have to be the same for all leads entered).  "lea3" is the id of the Company field... if you have modified your page layout greatly, this may be different for you.  If it doesn't work then you'll have to "view source" on the lead edit screen and search for the company field and find the proper id.