+ Start a Discussion
HelloSanHelloSan 

i want to fire the trigger(after update) when the custom lookup field is updated on Opportunity object otherwise the trigger should not fiel how can this be achieved using apex coding

Rahul SharmaRahul Sharma
Would suggest to try writing apex trigger on Opportunity first; and post your issues in case you run into issues, we would be happy to help!
Apoorv Saxena 4Apoorv Saxena 4

You could do something like this -->>

trigger updateOpportunity on Opportunity (after update) {
for (Integer i = 0; i < Trigger.new.size(); i++) {
if (Trigger.old[i].YourCustomLookupField__c != Trigger.new[i].YourCustomLookupField__c)  {

// Your Logic goes here. 

 }
}
}

Please let me know if this helps.

Thanks,

Apoorv.