Hi All,
Just to let everyone know there is a bug in NAV 2017 in function RemoveFailedJobs...
The function deletes job queue entries in error for the same object ID without considering if the parameter string is the same or not... or if the run interval is the same...
JobQueueEntry2.SETRANGE("Object Type to Run",JobQueueEntry."Object Type to Run");
JobQueueEntry2.SETRANGE("Object ID to Run",JobQueueEntry."Object ID to Run");
JobQueueEntry2.SETRANGE("Record ID to Process",JobQueueEntry."Record ID to Process");
JobQueueEntry2.SETRANGE(Status,JobQueueEntry2.Status::Error);
IF NOT JobQueueEntry2.ISEMPTY THEN
JobQueueEntry2.DELETEALL;
Quick fix is to also filter for the parameter string but you could still end up with deleted setup entries if you setup a job queue entry for the same task at different times...
I'm actually questioning if this code should just be commented entirely... I don't think it is good practice to delete user setup entries...
What's your opin
0
Comments
http://www.mibuso.com/dlinfo.asp?FileID=1123
It depends how you look at it I guess. If you assume that you have just one specific job per one record instance then it looks OK. Filtering for a combination of an object and specific "Record ID" seems to be unique enough. As far as I know standard Cronus code does not insert any job queue entries with parameters, so I guess it is not an error from Microsoft point of view.
Slawek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
How would the user understand why his correct setup records are disappearing?
http://www.mibuso.com/dlinfo.asp?FileID=1123