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
Rebecca ARebecca A 

Error message: Sync Cases with Activity Histories

Hi, I work at an organization without an in house developer. I'm hoping to determine how to address the following error message:

Apex trigger SyncCasesWithActivityHistories caused an unexpected exception, contact your administrator: SyncCasesWithActivityHistories: execution of AfterUpdate caused by: System.NullPointerException: Attempt to de-reference a null object: Class.ActivityHistoriesToCaseSyncer.TaskCounts.getDirectionForType: line 34, column 1

This error seems to occur randomly from time to time when saving routine information.

Thanks,

Rebecca
AbhishekAbhishek (Salesforce Developers) 
Hi Rebecca,

I guess there is Apex trigger/Class in place on Case object that is validating data, You could grab the error message & reach out to your developer to debug it. To find the Apex trigger:-

Go--Setup--Customize--Cases--Trigger---Search for the trigger with the name "Class.ActivityHistoriesToCaseSyncer"

Sorry, It's developer work.

I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.

Thanks.
DipthiDipthi
The "NullPointerException" is an error in Salesforce which occurs when a line of code is trying to use an object that has not been instantiated or expecting that a field is not empty. 

This can be rectified by updating the trigger and add a null value check before accessing the field.