Trigger worked on before and after DML operation
it's run automatically when DML fire on object
There are many type of context variable in trigger:-isInsert, isDelete, isUpdate, isBefore, isAfter, new, old, newMap, oldMap
trigger.new:- It's is a list of object and return current version of record id.trigger.old:- it's return old version of record Id.
trigger.newMap:- It is a set of Id and value. it's return current version of list of id and it's value, where ID always unic and value can be multiple.
trigger.oldMap:- it's also set of Id and value, it's always return old version of record id. Id always unic and value can be multiple.
Why we need handler in trigger class?
As per salesforce prospective we need to write a handler. We don't need to a complete code in to a trigger, or do not need to put the complete logic inside the trigger. because It's don't look like good practice. So For that we need to write handler classes and helper classes. If there is any common calculation that we want to do or any common logic that we want to perform two or three different methods. or perform two or three different triggers that are indirectly calling in the same objects. In that case we can go with helper classes other wise handler is sufficient.
To know more live demo source code in Salesforce lightning, Trigger, Visualforce & LWC, Use this link..
Thanks for info...
ReplyDeletePlZ visit
http://www.techsamarth.ml/2020/11/preparing-for-googles-page-experience.html
In this blog I get a great post sir please also visit my blog I post great content https://techkashif.com/special-delivery-web-series/
ReplyDeleteHi great thanks for sharing awesome info I really like your blog
ReplyDeleteGood and very enjoyable link and you get good level of collection is very good
ReplyDeleteTraffic Rider mod apk
hey just find the amazing content in you website and get the useful information from your website.
ReplyDeletehttp://sattamatkaa.net/ Satta matka