You need to sign in to do that
Don't have an account?
Samir Mahtani 4
what is this error when trying to run a background job?
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY:pc_rollup: execution of AfterUpdate
caused by: System.NullPointerException: Attempt to de-reference a null object
():--
It happens when an integration tried to run a background job. Some of the accounts it is updating do sync but the ones that fail have this error.
caused by: System.NullPointerException: Attempt to de-reference a null object
():--
It happens when an integration tried to run a background job. Some of the accounts it is updating do sync but the ones that fail have this error.
This error is caused by a line of code that is trying to use an object that has not been instantiated, or an object's attribute that has not been initialized.
If the field Site was left empty, it will generate the error message as(System.NullPointerException: Attempt to de-reference a null object) shown by the operation performed with the Integration done.
In order to avoid such issues, you should write try-catch blocks in your apex code and check if any of the fields which are required to be not null to succeed the operation. The exception can be smoothly handled with this technique.Also, additional logic checks in the code could avoid the records which are not eligible for update(which don't have the required fields) as well.
Reference:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_exception_trycatch_example.htm
The catch block handles the raised exception. Then the finally block executes. It writes a debug message and closes the stream writer, which frees any associated resources.
Hope above information helps, Please mark as Best Answer so that it can help others in the future.
Thanks.