You need to sign in to do that
Don't have an account?
Jake Jeon
Examples of Trigger.New.size() > 1
Hi all,
I’m a middle of make some trigger classes and found that trigger.new return list of sobject
What kind of situation would return size 2?
it would be much appreciated if someone give any examples of that
Thanks!
I’m a middle of make some trigger classes and found that trigger.new return list of sobject
What kind of situation would return size 2?
it would be much appreciated if someone give any examples of that
Thanks!
When someone tries to update the number of records using inline editing then the number of records involved in the update operation becomes the size of Trigger.New.Size()...So in the same way when someone tries to update the two records using inline editing then the Trigger.New.Size() becomes 2.
Thanks
Beenal
All Answers
When someone tries to update the number of records using inline editing then the number of records involved in the update operation becomes the size of Trigger.New.Size()...So in the same way when someone tries to update the two records using inline editing then the Trigger.New.Size() becomes 2.
Thanks
Beenal
Trigger.New is a List Collection Type. On List Collection we can do a Size method.
When you do a Insert or Update one record at a time, then the size will be 1. But when you try to do a Bulk update or bulk Import, the Trigger.Size will be >1. Normally when you write a Trigger will consider the both scenarios like Single record Updates/Insert or Multiple records Updates/Insert.
I hope this will help.
Thanks,
Narendar