You need to sign in to do that
Don't have an account?
prathap rao
How to Identify a n Account converted from a lead and an Account from the Account tab.
Is there any way in Salesforce to identify the converted account when compared to an Account created from the Account screen.
Does Salesforce differentiate based on ID or is it just the Lead Report after conversion that we need to refer to see the converted accounts?
You can query Lead Object (Lead.ConvertedAccountId, isconverted = true) with the current accountid
to find out if its an Account converted from a Lead.
--Satya
Find below a sample code of trigger to update the account field after lead conversion :
trigger trigMapFields on Lead (before update) {
for(Lead lead:System.Trigger.new)
{
if (lead.IsConverted)
{
// Assign the value from the Account "MasterContact" lookup field to the ContactID"
system.debug('<!---------Convert Leads 222 --------->');
Account acc = [SELECT Id,MasterContact__c FROM Account WHERE Account.Id:lead.ConvertedAccountId];
Contact con = [SELECT Id FROM Contact WHERE Contact.Id = :lead.ConvertedContactId];
acc.MasterContact__c = con.id;
update acc;
system.debug('<!---------Check Account Fields 111--------->' + acc.MasterContact__c);
}
}}
Hope this helps.
This is extrenely important functionality to lead management, success measurement in sales and lead performance
This needs to be implemented at the earliest possible time.
Thank you!
I've got a question on the WHERE part of this statement: Doesn't there miss an operator? Or what does "Account.Id : lead.ConvertedAccountId" do?
So if I understand it correctly: during lead conversion, first the new account is created and then the lead updates to "isConverted = true"? Otherwise I could not see that this would help me.
First, an empty account is created and then updated with all the fields' information
And thus this thread is solved.
So if you want to detect "was account created manually or from lead" you can compare Lead.ConvertedDate(Date type) and Account.CreatedDate(Datetime type). Or you can create checkbox in Account and fill it in the Lead trigger after converting.