• #67635
    Salesforce | Pooja Pooja #3
    Forcetalks

    What is the difference between the old and the new version of sobject records in Salesforce Trigger? 

    What is the difference between the old and the new version of sobject records in Salesforce Trigger?

     

    #67638
    Salesforce | Deepak Deepak #4
    Forcetalks

    Hi Pooja,

    New version returns List of new records before inserting into the Database.

    This is available in Before Insert, Before Update, After Insert, After Update Triggers and Undelete Triggers.

    Old version returns List of old records which are already inserted into the Database.

    This is available in Before update, after update, Before Delete and After Delete triggers.

    Hope it helps!

    #67706
    Forcetalks

    Hi,

     

    Trigger.new : Returns a list of the new versions of the sObject records. Note that this sObject list is only available in insert and update triggers, and the records can only be modified in before triggers.

     

    Trigger.old : Returns a list of the old versions of the sObject records. Note that this sObject list is only available in update and delete triggers

    #67708
     Marziya #9
    Forcetalks

    hii pooja,

    Trigger.New and Trigger.Old are both the context Variables which returns records in Lists.
    Trigger.New => works for the NEW values that are entering either it may be Insert or Update.
    Trigger.Old=> works for the OLD values that are already in the Fields, it may be to Delete or Update the records.

    ********************#########################***********************************
    Trigger.old: Returns a list of the old versions of the sObject records.

    Note that this sObject list is only available in the update and delete triggers.

    Trigger.oldMap: A map of IDs to the old versions of the sObject records. Note that this map is only available in the update and delete triggers.

    suppose you have a custom object Custom_obj__c

    Trigger.old means it is a List<Custom_obj__c>.

Viewing 4 posts - 1 through 4 (of 4 total)

Please to reply to this topic.

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2020 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?