Activity Forums Salesforce® Discussions What are the available Trigger contest variables in salesforce? Reply To: What are the available Trigger contest variables in salesforce?

  • Louis

    Member
    June 2, 2017 at 11:06 am

    Hi Saurabh,

    Context variable return true or false.

    1.       isBefore

    2.       IsAfter

    3.       IsInsertIsUpdate

    4.       IsUndelete

    5.       Old:-:- return old value of record in list

    6.       oldMap :- return old value of record in key value pairr

    7.       new:-return new  value of record in list

    8.       newMap :-return new  value of record in key value pair

    9.       return new  value of record in list

    10.   isExecuting-when trigger is fired from only from apex class

    11.   size :- total no of record in trigger invocation.

    thesevariables type is Boolean and return true or false. When a trigger is fired on an object then these variable return true as per the event of trigger.

    Example:-

    Trigger abc on account(isbefore,isafter,isInsert,isUpdate)

    If(isbefore()){

    If(isInsert()){

    //perform task

    }

    }