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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

How to get job queue id in report code

(0) ShareShare
ReportReport
Posted on by 259

Hi,

I have a report with one data item sales header. This report release sales order on after get record. I have also attached the code below.

Is there a possibility to get the job queue ID in this code? For example I have configured two Job queues and provided 2 orders in each job queue in parameters.

Order 1 & 2 will be processed by JOB 1 and Order 3 & 4 will be processed by JOB 2. I want to create a log that which order was processed by which Job queue?

Here is the report code  and I am using BC cloud version

dataset
{
   dataitem(SalesHeader; "Sales Header")
   {
       DataItemTableView = SORTING("Document Type", "No.") WHERE("Document Type" = CONST(Order));
       RequestFilterFields = "No."

       trigger OnAfterGetRecord()
       begin
          releaseOrder(SalesHeader);
          // get job queue id here and insert in a log table
       end;
    }
}

I have the same question (0)
  • Suggested answer
    JAngle Profile Picture
    133 on at

    There are other error message fields available in the job queue log entry table. However, for extra control your own log table might be worth while. Where the comment line is add a call to a procedure which passes the sales header as a parameter and the report is. Then you have the context of the order and report for inserting a line to a log table.

  • Danyal Profile Picture
    259 on at

    Hi Josh,

    Yes I have the context of order & report, but I want get the job queue id here which is currently executing the report. Is it possible to to get job queue id anywhere in report code?

  • JAngle Profile Picture
    133 on at

    Mild confusion. The job queue runs the report but you want the ID of the job queue entry as a value in an additional log table? That is already captured in the job queue log entry table.

  • Danyal Profile Picture
    259 on at

    I want that ID which is captured in job queue log entry table to be added in my custom log. Please consider below scenario.

    I have configured two Job queues for the same report  and provided 2 orders in each job queue in parameters.

    Order 1 & 2 will be processed by JOB 1 and Order 3 & 4 will be processed by JOB 2.

    How I can know that order 1 & 2 were processed by JOB 1 or JOB 2.

  • Suggested answer
    JAngle Profile Picture
    133 on at

    The job queue log entry table will have an event subscriber for OnAfterInsert. So that could insert the initial value in the custom log table. If supplementary data is needed then use the function I loosely mentioned earlier in your report but just filter some of the values. The job queue log entry itself will have all the necessary to filter for the result. Parameter, object ID, date.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,135

#2
YUN ZHU Profile Picture

YUN ZHU 733 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 612

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans