You need to sign in to do that
Don't have an account?
shaaf
Map Lead Fields to existing Account.Type field
I created a field called type in Leads and I would like to map it to the existing field Account.Type. However, this is not an option. Any way around this?
I can map fields that I have created in Leads to Accounts.
Thanks,
Sandy
Unfortunately you can't map custom fields to standard fields. If you don't want to create a custom field on Account, the workaround is to use an Account trigger (code) to populate Account.Type when the account is created.
trigger accountType on Account (before insert){
Set<Id> accts = new Set<Id>();
for (Account a: trigger.new()){
accts.add(a.Id);
}
List<Lead> leads=[select Id, Type__c FROM Lead WHERE convertedAccountId IN: accts];
Map<Id,String> leadMap=new Map<Id,String>();
for (Lead l: leads){
leadMap.put(l.ConvertedAccountID,l.Type__c);
}
for (Account a2: trigger.new()){
if (leadMap.containsKey(a2.Id){
a2.Type=leadMap.get(a2.Id);
}
}
}
where exactly does that code go to make sure it is triggered?
Create a new trigger on Account and it should fire at the right time.
Hello, I am trying to implement this and I am getting an unexpected token: "{" in like 12 column 34.
Any idea why this could be?