Attempt to de-reference a null object from RollupJob (as seen on Apex Jobs page)
afawcett opened this issue · 4 comments
caused by: System.NullPointerException: Attempt to de-reference a null object
Class.dlrs.RollupService.processScheduleItems: line 356, column 1
Class.dlrs.RollupJob.execute: line 48, column 1
Cause: This appears to be caused when using Schedule Mode and having upgraded to v2.0 with existing 'Lookup Rollup Summary Schedule Items' records in place (see corresponding tab). The new field 'Lookup Rollup Summary 2' on this object will not be populated on pre-existing records (new records are fine) and this causes the problem. Add this field to the layout and list view and sort by it to check.
Workaround: is to populate the 'Lookup Rollup Summary 2' field with the value (ID) of 'Lookup Rollup Summary' for each effected record (mass edit on list view is good for this) or delete the effected records and do Calculate to ensure all rollups are updated, then new Lookup Rollup Summary Schedule Items records will have this field populated correctly.
Code Fix is to ensure this code tolerates either the 'Lookup Rollup Summary' or 'Lookup Rollup Summary 2' fields containing a value, not just the new one.
Fixed v2.3.
I just upgraded from 2.4.2 to 2.11 and started seeing this exception. Also could this issue potentially impact other scheduled jobs? I am looking into it further.
Thanks @rajarak12 that is odd, this fix seemed to be ok at the time i have not heard of any issues until now. Maybe try the workaround described above? It is also possible its another issue. This will only impact your DLRS scheduled job called RollupJob not any others.
Hi was there any resolution to this error. I'm on v2.9 and received the following error message for a portion of failed batches.
Failed to process batch for class 'dlrs.RollupJob' for job id '7074600002fNQY7
caused by: System.NullPointerException: Attempt to de-reference a null object
Class.dlrs.RollupService.processScheduleItems: line 380, column 1
Class.dlrs.RollupJob.execute: line 48, column 1