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
HelmetHelmet 

Batch apex not working

Hi everyone,
I am using a batch apex where i am using a custom field from Account which is updated in a trigger.

The batch apex work perfectly when I desactivate the trigger, but when it is active it doens't work and here is the error:

"First error: Update failed. First exception on row 0 with id 001580000049cHmAAI; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, UpdateAcc: execution of BeforeUpdate
caused by: System.NullPointerException: Attempt to de-reference a null ..."


I hope that you could help me please

Thanks in advance.

saikat sarkarsaikat sarkar
Form the error it seems you are trying to pass account id to the Batch and the trigger is written in Before Insert, if so then you need to make it after insert as the Account id will not be accessable in Before insert. Please share the code for better understanding of your code.

Thanks
ManojjenaManojjena
Hi Mohamet,

If possible can you post your trigger code snipet so that we can help you .

Thanks 
Manoj