You need to sign in to do that
Don't have an account?
qbrown
populating a standard field with a custom field
Hi, i rewrote this post because I realized I wasnt being clear enough. Heres what im trying to do: when a lead is converted the parent account in lead needs to go over to the parent account in accounts. I found quickly that standard and custom fields cant be mapped together, but that a trigger could pull the data on conversion. I found a trigger here that I've attempted to use and I dont get any syntax errors with it, but when a lead is converted the parent account in accounts is left blank. Any help or suggestions would be appreciated, thanks!
heres the trigger:
trigger populateParentAccount on Account (before Insert){ List<Lead> convertedLeads=[SELECT Id, ConvertedAccountID, Parent_Account__c FROM Lead WHERE IsConverted=True AND ConvertedAccountId IN :trigger.new]; Map<ID,ID> acctParentMap=new Map<ID,ID>(); for (lead l: convertedleads){ acctParentMap.put(l.ConvertedAccountId,l.Parent_Account__c); } for (account a:trigger.new){ if (acctParentMap.containsKey(a.Id)){ a.ParentID=acctParentMap.get(a.Id); } } }
Hi,
Try this:
Thanks
All Answers
Hi,
Try this:
Thanks
thankyou! perfect