What is the trigger in salesforce?

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..



What is the trigger in salesforce? What is the trigger in salesforce? Reviewed by Admin on 1:32 AM Rating: 5

5 comments:

  1. Thanks for info...
    PlZ visit
    http://www.techsamarth.ml/2020/11/preparing-for-googles-page-experience.html

    ReplyDelete
  2. 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/

    ReplyDelete
  3. Hi great thanks for sharing awesome info I really like your blog

    ReplyDelete
  4. Good and very enjoyable link and you get good level of collection is very good
    Traffic Rider mod apk

    ReplyDelete
  5. hey just find the amazing content in you website and get the useful information from your website.
    http://sattamatkaa.net/ Satta matka

    ReplyDelete

header banner -- www.w3web.net



Powered by Blogger.