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
DorababuDorababu 

trigger to convert lead to person account or business account

Hi,

I have enabled person account in my org. I have created record types in Leads - Person Leads and Business Leads.

When converting a lead to account how can i convert a Person Lead to Person Account and Business Lead to Business Lead. (I have two custom vf pages for creation of person account and business account respectively.)

When i am trying to convert a person lead into person account, following error is thrown on 'Converted Status' field(when selected as qualified).

 

Error: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Last Name]: [Last Name] (System Code)

 

Any help will be appreciated

Best Answer chosen by Admin (Salesforce Developers) 
DorababuDorababu

Solved this issue with record type settings. For any one looking out for the same problem, go through the following link

 

1)http://login.salesforce.com/help/doc/en/admin_recordtype.htm
2)Implementing Person Accounts(pdf)

 

 

 

All Answers

Starz26Starz26

To convert a lead to a Business Account, enter a value for Company Name in the leads prior to conversion.

 

To convert a lead to a Person account, ensure that Company Name is blank prior to converting the lead.

DorababuDorababu

Hi Starz26

I have set two different pagelayouts for person account and business account. No company field on pagelayout of person Account. So no company field in person lead. How to convert a person Lead to Person Account / NO CONTACT IN CASE OF PERSON ACCOUNT / opportunity / create task in activities and business Lead to Business Account / Contact / Opportunity / task in Activity ?

Any help is appreciated

Sheikh Abrar Ul HaqSheikh Abrar Ul Haq

Dorababu,

 

If you want to create a Business Account than populate Name field of Account. If you want to create a Person Account then populate Last Name field on Account.

 

Further Details:

http://blog.jeffdouglas.com/2010/06/22/working-with-person-accounts-in-salesforce-com/

DorababuDorababu

I have partly solved the above problem, now I am able to convert the Person Lead to Account. But when I tried to convert a business lead, I got the Following message / error.

 

Record Type Unavailable

 


Cannot find recordtype of the appropriate type.

Click here to return to previous page.

 

Any help will be appreciated.

 

 

 

 

DorababuDorababu

Solved this issue with record type settings. For any one looking out for the same problem, go through the following link

 

1)http://login.salesforce.com/help/doc/en/admin_recordtype.htm
2)Implementing Person Accounts(pdf)

 

 

 

This was selected as the best answer