DeleteMultiple cannot be used with filters when a companion table is present for the specified record
Please advise on the following issue. Is it a bug or expected behavior?
Recently I added a function on the Job Queue Log Entries page to delete selected records. I also extended the Job Queue Log Entry table with two fields.
When I do a deleteall on my selection I get this error message:

Code looks like this:
local procedure DeleteSelected();
var
JobQueueLogEntry : Record "Job Queue Log Entry";
begin
CurrPage.SetSelectionFilter(JobQueueLogEntry);
if Confirm(StrSubstNo(AreYouSureQst, CurrPage.Caption()), false) then
JobQueueLogEntry.DeleteAll(true);
end;
var
AreYouSureQst : Label 'Are you sure you want to delete these %1?', comment = '%1 is the page caption';
What you are seeing is a platform defect. When an efficient SQL bulk operation cannot be performed (triggers exist, events exist, companion tables exist + filters/marks, etc...) the platform should be automatically handling the DELETEALL as a loop using FIND and DELETE. No change to AL is needed - this is transparent.
There seems to be a defect where the presence of marked records is not causing this fallback. We need to fix this in the platform.
A short-term workaround would be to replace the call to DELETEALL with a FIND/DELETE loop to mimic what the platform is already going to do to the code at runtime.
Thanks for getting back to me. I had already created a workaround with a repeat loop which works fine.