You need to sign in to do that
Don't have an account?
Melinda Kay
Reportable Notes relation to account after lead conversion
I want users to make reportable notes on leads- but after lead conversion, the notes need to be reassociated to the account... I am having the same challenge with attachments- which also should be reassociated to the account upon lead conversion. Here is a trigger for the lead- can someone help me identify the problems with it working? Thank you!
trigger AssociateLeadReportableNoteToAccount on Lead (after update) {
List<Lead> leads = trigger.new;
for (Lead lead : leads) {
if (lead.IsConverted) {
List<Reportable_Note__c> reportablenote = [Select Reportable_Note__c.Related_to_Account__c From Reportable_Note__c Where Reportable_Note__c.Lead__c =: lead.Id];
for (Reportable_Note__c reportablenote : reportablenotes) {
reportablenote.Related_to_Account__c = lead.convertedAccountId;
update reportablenote;
}
}
}
}
trigger AssociateLeadReportableNoteToAccount on Lead (after update) {
List<Lead> leads = trigger.new;
for (Lead lead : leads) {
if (lead.IsConverted) {
List<Reportable_Note__c> reportablenote = [Select Reportable_Note__c.Related_to_Account__c From Reportable_Note__c Where Reportable_Note__c.Lead__c =: lead.Id];
for (Reportable_Note__c reportablenote : reportablenotes) {
reportablenote.Related_to_Account__c = lead.convertedAccountId;
update reportablenote;
}
}
}
}
You update the code : Refer Below --
Hope this helps, let me know in case of any issue
--
Thanks,
Swayam
@salesforceguy
All Answers
You update the code : Refer Below --
Hope this helps, let me know in case of any issue
--
Thanks,
Swayam
@salesforceguy