I've got a project where I'm looking to tweak the standard lead conversion process.
Triggers and lead conversion has always been funky in past projects so I was hoping to start the design off by reviewing the order of execution, but after a long google search I'm coming up empty handed.
Anyone out there know the specific trigger order for lead conversion?
Edit: I'm not asking about trigger execution order for any object, but all the objects created in the lead conversion process. I'd think it would be something like this:
- Lead Before Update Triggers (isConverted = false, convertedAccountId = null, convertContactId = null, convertedOpportunityId = null)
- Account Before Insert Triggers (not fired if merged with existing account)
- Account After Insert Triggers (not fired if merged with existing account)
- Contact Before Insert Triggers (not fired if merged with existing contact)
- Contact After Insert Triggers (not fired if merged with existing contact)
- Opportunity Before Insert Triggers (not fired if no opportunity) (OpportunityContactRoles null)
- Opportunity After Insert Triggers (not fired if no opportunity) (OpportunityContactRoles = convertedContactId)
- Lead After Update Triggers (isConverted = true, convertedAccountId = XXX, convertedContactId = XXX, convertedOpportunityId = XXX)
System.Debug("Trigger on Object before/after Action");
-- then you could convert a lead and check the system log.