You need to sign in to do that
Don't have an account?
Rabbani sayyed 8
What is the trigger.newmap and trigger.oldmap and when to use these two in triggers? can anyone share me the answer for this in detail?
What is the trigger.newmap and trigger.oldmap and when to use these two in triggers? can anyone share me the answer for this in detail?
newMap and oldMap are just maps of ids where new and old are lists.
Here is the definition for each of the Trigger Context Variables https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_context_variables.htm.
Hope this helps,
Fred
All Answers
Go through this links when to use trigger.old and triigger.new and hw to use them?
https://help.salesforce.com/apex/HTViewSolution?id=000003789&language=en_US
http://www.sfdc99.com/2014/02/25/comparing-old-and-new-values-in-a-trigger/
Thanks
Anil.B
newMap and oldMap are just maps of ids where new and old are lists.
Here is the definition for each of the Trigger Context Variables https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_context_variables.htm.
Hope this helps,
Fred
To add on to Frederic's post, that page also lists when each map is available, which is especially important for triggers firing on insert and delete.
If these answers helped you solve your problem, please, mark the question as Solved and kindly select the best one ;)
Thanks,
Fred