function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Avinash NelluriAvinash Nelluri 

Map size different in before update and after update triggers

Hi,

I've come across a null pointer exception. After I started diggin in, I realized that before update contains 163 records where as after update contains only 161 records. I have never encountered such a scenario. Can some one educate me about the possible scenarios for dropping some records in after trigger?

Thanks..
Best Answer chosen by Avinash Nelluri
Avinash NelluriAvinash Nelluri
Answering my own question :

The two records that got dropped encountered validation errors. Ideally, I should have received validation error. But, in the update operation, allOrNone was set to false. So it didn't throw any error in before update, but dropped those records at the end of before update. So after update doesn't contain those 2 records and has only 161 records.