function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
aditya3aditya3 

Learning Apex Classes and Triggers

HI all,
(System.Trigger.isInsert ||
(lead.Email != System.Trigger.oldMap.
get(lead.Id).Email)))
How can I understand this ?here get() is the method in the oldMap or how many methods are there  in oldMap? and where to use get ()put()set()??orelse we can use where ever we want ??

Please help me ..I am Learning Apex classes and Triggers
 
Nirmal ChristopherNirmal Christopher
trigger.oldmap is a kind of a collection variable which stores the records before the database commit occurs. Its just a map collection element. So all the map supported methods will apply for this element.
please look at the below link for the map methods which can be used.

http://www.salesforce.com/us/developer/docs/dbcom_apex250/Content/apex_methods_system_map.htm

Hope I answered your question. Hit best anser button if its helpful.

Regards,
Nirmal