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

Announcements

No record found.

News and Announcements icon
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
    157 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
    157 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
    157 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,065 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,132 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 703 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans