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;
    }
}

  • Suggested answer
    JAngle Profile Picture
    89 on at
    RE: How to get job queue id in report code

    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.

  • Danyal Profile Picture
    259 on at
    RE: How to get job queue id in report code

    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.

  • JAngle Profile Picture
    89 on at
    RE: How to get job queue id in report code

    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
    RE: How to get job queue id in report code

    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?

  • Suggested answer
    JAngle Profile Picture
    89 on at
    RE: How to get job queue id in report code

    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.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

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

#1
YUN ZHU Profile Picture

YUN ZHU 446 Super User 2025 Season 1

#2
Sagar Dangar, MCP Profile Picture

Sagar Dangar, MCP 339

#3
Mansi Soni Profile Picture

Mansi Soni 320

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans