web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Job Queue Entry just disappears when it's supposed to be running.

(0) ShareShare
ReportReport
Posted on by 50
Hello, i created a Job Queue Entry ( via the following function ) . This Job is scheduled for time X. Instead of running the job disappears at time X it disappears without traces. Why is that? I can't see anything different to other jobs.
    local procedure CreateJobQueueEntry(SessionId: Guid; ScheduledFor: DateTime): Guid
    var
        l_JobQueueEntry: Record "Job Queue Entry";
        l_JobQueueEntryId: Guid;
    begin
        l_JobQueueEntry.Init();
        l_JobQueueEntry.ID := CreateGuid();
        l_JobQueueEntry."Object Type to Run" := l_JobQueueEntry."Object Type to Run"::Codeunit;
        l_JobQueueEntry."Object ID to Run" := Codeunit::"BHLF-ConfigPkgImportJQHandler";
        l_JobQueueEntry."Parameter String" := CopyStr(Format(SessionId), 1, MaxStrLen(l_JobQueueEntry."Parameter String"));
        l_JobQueueEntry.Description := CopyStr('Config Package Import - ' + Format(SessionId), 1, MaxStrLen(l_JobQueueEntry.Description));
        l_JobQueueEntry."Earliest Start Date/Time" := ScheduledFor;
        l_JobQueueEntry."Expiration Date/Time" := ScheduledFor + 1;
        l_JobQueueEntry."Maximum No. of Attempts to Run" := 3;
        l_JobQueueEntry."Rerun Delay (sec.)" := 60;
        l_JobQueueEntry."Run in User Session" := false;
        l_JobQueueEntry."Job Queue Category Code" := '';
        l_JobQueueEntry."User ID" := CopyStr(UserId, 1, MaxStrLen(l_JobQueueEntry."User ID"));
        l_JobQueueEntry.Status := l_JobQueueEntry.Status::"On Hold"; // Explicitly set initial status
        l_JobQueueEntry.Insert(true);
        l_JobQueueEntryId := l_JobQueueEntry.ID;
        Commit();
        l_JobQueueEntry.Get(l_JobQueueEntryId);
.
        if TaskScheduler.CanCreateTask() then
            l_JobQueueEntry.SetStatus(l_JobQueueEntry.Status::Ready);
        exit(l_JobQueueEntryId);
    end;
I have attached screenshots of the Job Queue Entry, the Task and the Job Card. Does anyone have an idea why? 

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,837

#2
YUN ZHU Profile Picture

YUN ZHU 952 Super User 2025 Season 2

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 946

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans