mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-05 14:46:55 +01:00
49 lines
No EOL
971 B
AL
49 lines
No EOL
971 B
AL
table 50114 "Job Cancellation Control"
|
|
{
|
|
DataClassification = SystemMetadata;
|
|
|
|
fields
|
|
{
|
|
field(1; "Job Queue Entry ID"; Guid)
|
|
{
|
|
}
|
|
field(2; "Stop Requested"; Boolean)
|
|
{
|
|
}
|
|
}
|
|
|
|
keys
|
|
{
|
|
key(PK; "Job Queue Entry ID")
|
|
{
|
|
Clustered = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
codeunit 50114 "Job Queue On Hold Good"
|
|
{
|
|
TableNo = "Job Queue Entry";
|
|
|
|
trigger OnRun()
|
|
begin
|
|
while not IsStopRequested(Rec.ID) do
|
|
if not ProcessNextBatch() then
|
|
exit;
|
|
end;
|
|
|
|
local procedure IsStopRequested(JobQueueEntryId: Guid): Boolean
|
|
var
|
|
JobCancellationControl: Record "Job Cancellation Control";
|
|
begin
|
|
if not JobCancellationControl.Get(JobQueueEntryId) then
|
|
exit(false);
|
|
|
|
exit(JobCancellationControl."Stop Requested");
|
|
end;
|
|
|
|
local procedure ProcessNextBatch(): Boolean
|
|
begin
|
|
exit(false);
|
|
end;
|
|
} |