I knew I could to this by Marking the records where the job was blocked and then showing only Marked records. This is the Gotcha: the default parameter for the Mark and MarkedOnly functions is false meaning it will effectively not do anything. The online help tells you this but still it’s a bit of a puzzler if you don’t do these things very often.
My code for Only Records with Blocked Jobs is as follows:
IF Rec.FINDSET THEN
IF "Job No." <> '' THEN BEGIN
IF lJob.Blocked <> lJob.Blocked::" " THEN BEGIN
lBlockedJobsFound := TRUE;
UNTIL Rec.NEXT = 0;
IF lBlockedJobsFound THEN
MESSAGE('No blocked jobs found in this journal batch.');
My code for showing all records is as follows:
Still, it would be nice if the end-user could have applied this filter as they would be able to in Microsoft CRM. Maybe one day future versions of NAV will allow the user to define filters using related tables too.