0

I have a Field called "Business Type" on LEAD which is of type picklist. I am using LeadConvert method to convert a lead to Account, contact, Opportunity. While I convert the lead, I want to assign the recordtype of the account dynamically with respect to "Business Type". How is this possible when using LeadConvert Class. At present, a default recordtype of account is getting assigned when a lead is converted.

Documentation for LeadConvert class: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_dml_convertLead.htm

2 Answers 2

1

In addition to DavidCheng suggestion,

If you map the value of Lead.BusinessType to a field in Account, say Account.Business_Type__c (via Lead Mapping), then you can either use

  • Before Save Flow to coerce the Account.RecordtypeId
  • Before Insert Trigger to coerce the Account.RecordtypeId
2

It's not possible to specify an Account record type during lead conversion. Either you'll have to create the account before the lead conversion and use setAccountId(), or change the new account's record type after lead conversion using on the ConvertedAccountId field.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .