Explain the difference between trigger.new and trigger.newmap?



Explain the difference between trigger.new and trigger.newmap?..

Answer / Yudhisthir Naik

'trigger.new' is a collection of all the records that are being inserted or updated in the current context. It contains all the new or changed records that will be processed by the Apex trigger. On the other hand, 'trigger.newMap' is a Map data type (specifically, a List<SObject> Map) where each key is the record ID and the value is the record itself from 'trigger.new'. This allows for easier access to individual records.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Salesforce Interview Questions

Can two users have the same profile? Can two profiles be assigned to the same user? : salesforce crm

1 Answers  


Does salesforce stores the deleted objects and fields? : salesforce objects & fields

1 Answers  


Explain class constructors with example?

1 Answers  


Can two profiles be assigned to the same user?

1 Answers  


What is the success of the Salesforce Cloud Service?

1 Answers  


List the various object relations in salesforce?

1 Answers  


Difference between Rest and SOAP?

1 Answers  


What are the tools included in lightning ?

1 Answers  


Can two users have the same profile?

1 Answers  


What are lightning events ? Where do you use them ?

1 Answers  


Throw some light on implementing pagination in a visualforce page.

1 Answers  


What is tab in salesforce? What is the difference between adding a custom tab to an app in classic and lightning?

1 Answers  


Categories