You need to sign in to do that
Don't have an account?
udayarangareddy mekala
Trigger3232
Hi
Please tell me how to compare the oldvalue fields to the newvalue fields in the trigger testclass
Thanks
rangareddy
Please tell me how to compare the oldvalue fields to the newvalue fields in the trigger testclass
Thanks
rangareddy
In test class you can trigger the code of trigger through DML action.
And in Trigger code you can get the value of Trigger.Old and Trigger.new values of the reord.
Trigger.old is null in the cases for eg. in insert opperation.
Test class
-Thanks
Ashlekh Gera
Generally the old values can be obtained in the trigger using either Trigger.OldMap or Trigger.Old. All the content in those list are Old values, where as, the content of the Trigger.NewMap and trigger.New are New values.
Remember, Trigger.Old values will be same for the entire execution and you can easily differentiate old values from the new values as shown in above example