Like many folk out there, I want to remove the requirement that a new Lead object needs to have something in the Company field. From various discussions (like this one) it looks like it is not possible to make it a non-required field.
BUT, I have worked on an instance where the following piece of test code runs perfectly fine:
Lead freshLead = new Lead(); freshLead.Email = 'email@example.com'; freshLead.LeadSource = 'Email'; freshLead.FirstName = 'John'; freshLead.LastName = 'Doe'; // note: no freshLead.Company = 'Unknown'; insert freshLead;
How is this done?