+ Start a Discussion

Getting the OLD values of related object field in the update trigger

Hi Guys,


I have a custom object "OppService__c" in which I have a lookup field some set of values.


I have written a trigger which will work when the look up field is selected with a value starting with "RSN" Id of the particular OppService__c record should be sent to my apexclass.


My trigger is working fine for insert feature and returning the id to the class.


but for update function,  i want to get its Old value to compare so as to if the old value of the field is also starting with RSN the id of the record should not be passed to the class...........



The Name field in the OddService__C object being the related field from another object, only null value is returned if

I use like this:




Please suggest is there any other way to get the old value of the related object field in the Update trigger.


You can use trigger.old, take value from record and save it in global variable then you can able to use this value through out trigger....