You need to sign in to do that
Don't have an account?
Pavan Vadlamudi
after update trigger is not firing after workflow field update action.
I have the scenario that when ever stage is updated with closed won we are creating another open opportunity.
This update is manula update and working fine.
For same scenario we have workflow to update the record with closed won in this case after update trigger is not working fien.
could anyone suggest me the cause.its kind of priority to me now.
This update is manula update and working fine.
For same scenario we have workflow to update the record with closed won in this case after update trigger is not working fien.
could anyone suggest me the cause.its kind of priority to me now.
All Answers
trigger OpportunityTrigger on Opportunity (after insert,before delete,after update,before insert,before update) {
//Creating New and Old Cpp Opportunity List for after update
List<Opportunity> oldCppopp = new List<Opportunity>();
List<Opportunity> newCppopp = new List<Opportunity>();
//Creating New and Old Maps
Map<Id, Opportunity> newCppOppMap=new Map<Id, Opportunity>();
Map<Id, Opportunity> oldCppOppMap=new Map<Id, Opportunity>();
//Creating New and Old Cpp Opportunity List for before insert and update
List<Opportunity> oldbfrCppopp = new List<Opportunity>();
List<Opportunity> newbfrCppopp = new List<Opportunity>();
if((Trigger.isInsert) && (Trigger.isAfter)||(Trigger.IsUpdate && Trigger.isAfter)){
//The below method is commented as part of the new requirment that child oppotunity will create manually.
OpportunityLogicHandle.createOpportunity(trigger.new,trigger.old);
}
if((Trigger.isUpdate)&& (Trigger.isAfter)){
oldCppopp = Trigger.Old;
newCppopp = Trigger.new;
newCppOppMap=Trigger.newMap;
oldCppOppMap=Trigger.oldMap;
OpportunityLogicHandle.createChildOpportunity(oldCppopp,newCppopp );
}
if(((Trigger.isInsert) && (Trigger.isBefore))||(Trigger.isupdate) && (Trigger.isBefore)){
//Assigining Old Opportunities for Update event as Old date is not avilaible for before insert
if(Trigger.IsUpdate && Trigger.isBefore){
oldbfrCppopp=Trigger.Old;
}
newbfrCppopp =Trigger.New;
OpportunityLogicHandle.populateValues(newbfrCppopp,oldbfrCppopp);
}
}