Business Central Customization: Automating Purchase Quote → Purchase Order
In a standard Business Central purchasing process, after a Purchase Quote is approved, the user may still need to manually convert it into a Purchase Order and release the order.
we implemented a customization to automate this entire step:
Purchase Quote → Approval → Released Quote → Automatic PO Creation → Automatic PO Release
Technical Implementation
The customization subscribes to the standard OnAfterReleasePurchaseDoc event from the Release Purchase Document codeunit.
[EventSubscriber(
ObjectType::Codeunit,
Codeunit::"Release Purchase Document",
'OnAfterReleasePurchaseDoc',
'',
false,
false)]
local procedure OnAfterReleasePurchaseDoc(
var PurchaseHeader: Record "Purchase Header")
begin
if PurchaseHeader."Document Type" =
PurchaseHeader."Document Type"::Quote then
CreatePOFromQuoteSafe(PurchaseHeader);
end;
Once the Purchase Quote is released, the extension first checks whether the quote has already been converted.
if AlreadyConverted(PurchaseHeader) then
exit;
This prevents duplicate Purchase Orders.
The standard Business Central Purch.-Quote to Order codeunit is then reused instead of implementing the conversion logic from scratch:
[TryFunction]
local procedure TryCreatePO(
var PurchaseHeader: Record "Purchase Header")
begin
Codeunit.Run(
Codeunit::"Purch.-Quote to Order",
PurchaseHeader);
end;
After the PO is created, the newly created Purchase Order is identified using the Quote No.:
PurchHeaderOrder.SetRange(
"Document Type",
PurchHeaderOrder."Document Type"::Order);
PurchHeaderOrder.SetRange(
"Quote No.",
PurchaseHeader."No.");
if PurchHeaderOrder.FindFirst() then begin
Codeunit.Run(
Codeunit::"Release Purchase Document",
PurchHeaderOrder);
end;
Automated Process
Before customization:
Purchase Quote → Approval → Manual Conversion → Manual Release
After customization:
Purchase Quote → Approval → Automatic PO Creation → Automatic PO Release
Additional Integration
After successful PO creation, I also implemented an External Business Event:
[ExternalBusinessEvent(
'POCreated',
'PO Created',
'Trigger when PO is created',
EventCategory::System)]
procedure POCreated(
DocumentNo: Code[20];
VendorName: Text[100];
RequestedBy: Code[50];
SenderEmail: Text[100];
Amount: Decimal;
ApproverEmails: Text[250];
CurrCode: Text[10];
ApproverIds: Text[250])
begin
end;
This event can be consumed by Power Automate to trigger notifications or other downstream processes.
Key Business Central Concepts Used
• Event Subscribers
• Standard Codeunit Reuse
• Purchase Quote → Purchase Order Conversion
• Automatic Document Release
• Duplicate Conversion Prevention
• Error Handling with TryFunction
• Custom Process Logging
• External Business Events
• Power Automate Integration
This is a good example of using Business Central's event-driven architecture to automate a manual business process while keeping the customization separated from the standard application.
If you customize Microsoft Dynamics 365 Business Central to automate the Purchase Quote → Purchase Order process, the main benefits are:
Key Benefits
-
Faster purchase processing
-
Approved purchase quotes can be converted into purchase orders with fewer manual steps, reducing processing time.
-
Less manual data entry
Vendor, item, quantity, price, dimensions, and other quote information can flow automatically into the purchase order, reducing duplicate entry.
-
Fewer errors
Automation reduces the risk of typing incorrect quantities, prices, vendor details, or item information when creating the PO.
-
Better approval control
The customization can be designed so that a purchase order is created only after the required approval is completed.
-
Improved purchasing workflow
A clear workflow can be established:
Purchase Quote → Review → Approval → Purchase Order → Receipt → Invoice
-
Better auditability
The system can retain the relationship between the original purchase quote and the resulting purchase order, making it easier to track purchasing decisions.
-
Improved procurement visibility
Purchasing teams can quickly see which quotes are pending, approved, converted, or still awaiting action.
-
Reduced processing costs
By eliminating repetitive administrative work, the procurement team can spend more time on vendor management, negotiations, and strategic purchasing.
-
Consistent purchasing processes
Automation helps standardize the quote-to-order process across departments, locations, and users.
-
Scalable procurement operations
As the number of vendors, purchase requests, and transactions increases, an automated workflow can handle higher volumes without requiring the same increase in manual effort.
Dynamics 365 Business Central customization can automate the Purchase Quote to Purchase Order process, reducing manual data entry, minimizing errors, improving approval control, and accelerating procurement operations. By connecting each stage of the purchasing workflow, businesses gain greater visibility and consistency across their procurement processes.
