You need to sign in to do that
Don't have an account?
ppat
Lead Convert - Opportunity "before Insert" Trigger does not get fired ?
I have following simple trigger to populate one field from account.
When I convert the lead and create new opportunity , this trigger does not get fired .. However if I change something in opportunity after creation , trigger gets fired and this is due to before update. I also tried to insert opportunity directly and trigger is working as expected
Seems like "before insert" is not working after lead conversion to opportunity
Is there any limitation of the Triggers that it does not get fired when lead is converted ? Can someone please let me know if there is a workaround ?
trigger OpportunityInsert on Opportunity (before insert,before update)
{
for (Opportunity o : Trigger.new)
{
if (o.regpartner != NULL)
{
//dc --> Distributor Center
Account dc = [Select Id, oc from Account where id = :o.regpartner];
o.oc = dc.oc;
}}}
When I convert the lead and create new opportunity , this trigger does not get fired .. However if I change something in opportunity after creation , trigger gets fired and this is due to before update. I also tried to insert opportunity directly and trigger is working as expected
Seems like "before insert" is not working after lead conversion to opportunity
Is there any limitation of the Triggers that it does not get fired when lead is converted ? Can someone please let me know if there is a workaround ?
trigger OpportunityInsert on Opportunity (before insert,before update)
{
for (Opportunity o : Trigger.new)
{
if (o.regpartner != NULL)
{
//dc --> Distributor Center
Account dc = [Select Id, oc from Account where id = :o.regpartner];
o.oc = dc.oc;
}}}
This can be located under App Setup > Customize > Leads > Settings.
I will followup with salesforce.com support