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 can I use Job Queues to Convert Release Purchased Quotes to Purchase Orders Every

(1) ShareShare
ReportReport
Posted on by 2

Hi All

I need step by step on how to setup a job queue to automatically run every 5 minutes on converting any released purchase quotes in purchase orders.

Your help would be much appreciated! I understand the job queue cannot just be created on its own without having to create a custom report/codeunit for the job queue to call on. If someone can please break this down for me, that would be lifesaving.

The job queue I created (attached) returned an error Record(472) is not compatible with Codeunit.Run(Record(38)).

Please help!

 

Thanks

Marissa

Screenshot 2025-02-03 154616.png
I have the same question (0)
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,443 Super User 2025 Season 2 on at
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,443 Super User 2025 Season 2 on at
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,443 Super User 2025 Season 2 on at
    Create custom codeunit: 
    codeunit 50100 "AutomatedPurchQuoteToOrder"
    {
        Subtype = Normal;
        trigger OnRun()
        var
            PurchQuoteToOrder: Codeunit "Purch.-Quote to Order";
            PurchHeader: Record "Purchase Header";
        begin
           
            // Get all open Purchase Quotes
            PurchHeader.RESET;
            PurchHeader.SETRANGE("Document Type", PurchHeader."Document Type"::Quote);
            PurchHeader.SETRANGE(Status, PurchHeader.Status::Released); // Only Released quotes
     
            // Loop through each open Purchase Quote and convert it to Order
            if PurchHeader.FINDSET THEN BEGIN
                REPEAT
                    // Call the existing "Purch.-Quote to Order" codeunit to make the order
                    PurchQuoteToOrder.RUN(PurchHeader);
                UNTIL PurchHeader.NEXT = 0;
            END
        end;
    }
     
    Set this Codeunit in job queue and run it: It will create purchase orders for all the released quotes.
     
    Regards,
    Khushbu Rajvi
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,443 Super User 2025 Season 2 on at

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,362

#2
YUN ZHU Profile Picture

YUN ZHU 867 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 607

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans