Breeze Interface for Dynamics 365 BC - en-US
Manual for the administration and use of BREEZE for Microsoft Dynamics 365 Business Central.
We deliver our all-in-one BREEZE workflow solutions for document-oriented business processes from a single source, whether as OnPremises or as Solution-as-a-Service.
The BREEZE workflow engine quickly steers documents and data through the entire review process with simple "if-then" rules and conditions, all the way to final approval.
- System Requirements
- Installation
- Configuration & Administration
- Permission sets
- DEXPRO Core
- Breeze Interface Setup
- Document Class Setup
- Target Template Setup
- Generic Custom Fields
- OAuth 2.0 setup (for SaaS only)
- Breeze Workflow
- Authentication (on-premises)
- Application / Usage
- Extension Development
System Requirements
System requirements for using BREEZE for Dynamics 365 BC
Supported Microsoft Dynamics 365 Business Central versions
Microsoft Dynamics 365 Business Central integration is possible from the following version due to minimum technical requirements:
Supportet Microsoft Dynamics 365 Business Central Versions
The prerequisite for operation is that the respective Microsoft Dynamics 365 Business Central version is still in regular support. The extended support is excluded.
Licensing — Customer/Partner Responsibility: Editing Business Central data still requires each approver/editor to hold a suitable, paid Business Central user licence; a Microsoft 365 licence alone is not sufficient. DEXPRO makes no warranty regarding licensing — the customer and their Microsoft licensing partner are responsible for clarifying the exact requirements with Microsoft.
Supported BREEZE versions
A licensed BREEZE system is required to connect BREEZE to Microsoft Dynamics 365 Business Central and for operation.
- minimum Documents Version: Documents 5h #2311
- minimum DEXPRO Invoice Solution Version: Invoice 1.1.015
Installation
Licenses
Microsoft
Information about the Microsoft Business Central licenses.
BREEZE
The DEXPRO BREEZE system that should be connected to Business Central requires a valid customer license.
Obtaining the DEXPRO modules
Detailed informationen are here.
OnPrem
For OnPrem installations, an runtime package with the required apps is provided upon request of a registered reseller / partner. These modules are added to the customer license by the partner and then imported into Microsoft Dynamics Business Central. It should be noted that the DEXPRO Core module forms the basis for all DEXPRO modules and must therefore be imported first.
Cloud
For cloud installations, you only need the Microsoft AppSource. This is where the required DEXPRO modules are downloaded.
Configuration & Administration
Permission sets
In order to use the modules, the appropriate authorization set must be assigned to the respective users.
The following are supplied with:
-
DXP Core Admin - DEXPRO Core Administrator
-
DXP Core User - DEXPRO Core User
- DXP BREEZE Admin - DEXPRO BREEZE Administrator
- DXP BREEZE User - DEXPRO BREEZE User
DEXPRO Core
The DEXPRO Core manages the individual DEXPRO apps and their documents per client.
All documents that have been entered and processed via the various DEXPRO modules in Microsoft Dynamics 365 Business Central are displayed. A global number series, which is used across all DEXPRO apps, is used to complete individual documents. This offers the advantage that users only have to work with one number series per document.
Further information can be found here.
Breeze Interface Setup
In the Breeze Interface setup, processing is set up within the app.
Process
Copy Setup
This copies the setup to other clients.
Navigation
Document class setup
Target Template Setup
General
In this FastTab you can enable/disable the use of this app.
No. Series
The number series for the Breeze Interface documents is stored here.
Viewer
This FastTab contains the Viewer in Documents setting (Boolean). If enabled, a document-viewer factbox is shown on the Breeze Documents page, so that the original document can be previewed directly while processing the Breeze entry. This setup group is only visible when the SQUEEZE app is installed.
{add screenshot of the Viewer FastTab with the "Viewer in Documents" toggle here}
Document Class Setup
In the document class setup, each document class is configured for processing. The document class setup is cross-app and is managed via the DEXPRO Core; the Breeze Interface adds the settings described below. For the general (cross-app) configuration of document classes, see the Core Document Class Setup page.
General
In this FastTab the name of the document class and the next process step are set up. To route Core documents of this document class into the Breeze app, set Next Process Step to "Breeze Interface". The Breeze settings below only become visible once this next process step is selected.
Breeze
Here you set the Breeze Target Template for this document class. This is the default target template that is used when a Breeze document is created for this document class.
The following are available as standard:
Target Template Setup
Target templates for the Breeze interface are managed here. These templates are available by default:
General
Here you can see which target template is currently being edited.
The Do Not Release toggle (labeled Disable Release on the page) is also located in this group. If enabled, the automatic release of the document created from the Breeze entry is suppressed, so that the document is created but left unreleased for manual processing.
Plausibility Check
Here, certain plausibility checks per target template can be deactivated. This group is only visible when the Target Template is set to a value other than None.
The following toggles are available:
- Ignore Vendor Blocked (Payment) – skips the check of the vendor's payment-blocked status when the block is set to "Payment".
- Disable Amounts Check – deactivates the plausibility check of the document amounts.
- Disable Posting Date Check – deactivates the check of the posting date.
Generic Custom Fields
Customer-specific fields can be added here that extend or deviate from our standard template. This mapping ensures that this additional content is assigned to the right places.
The corresponding BC field is assigned to each technical JSON field name.
On the Breeze side, the fields must be added via the additionalFields.
OAuth 2.0 setup (for SaaS only)
Access to web services in Microsoft Dynamics 365 Business Central (BC) in the SaaS version is only possible via OAuth 2.0. The necessary setup of the app in Azure Active Directory and its link to BC is described below.
For on-premises installations, see Authentication (on-premises).
Azure Portal
Launch Azure Portal and open Microsoft Entra ID
Create a new app under App registrations
Create API permissions
The Application (client) ID can already be copied and stored at this point (will be needed later)
Create Client secret and store it in a secure location
Business Central
Open Microsoft Entra Applications and create a new entry
Set up Microsoft Entra Application
- Enter the Client ID
- Enter description (description is a bit misleading. This is rather a user name).
- Assign user permission set(s) individually.
- (Optional)
- Activate application
Breeze Workflow
To connect our Breeze Invoice Workflow to Dynamics 365 BC please read this manual.
Authentication (on-premises)
On an on-premises installation of Business Central, access to the web services is not limited to OAuth 2.0. This page describes how BREEZE and other systems authenticate there. For Business Central online, see OAuth 2.0 setup (for SaaS only).
Difference between SaaS and on-premises
In October 2022, Microsoft switched off authentication with web service access keys (Basic Auth) in Business Central online only. On-premises, Business Central still accepts both methods:
- User name and password: the caller signs in with a BC user and that user's password or web service access key.
- OAuth 2.0: the caller signs in through an app registration in Microsoft Entra ID, as with SaaS.
Connecting BREEZE
BREEZE connects to an on-premises installation through the connection type Dynamics 365 BC (on Prem). This connection type signs in with a user name and password. BREEZE offers OAuth 2.0 only with the connection type Dynamics 365 BC (SaaS). The connection fields are described in the BREEZE documentation under Verbindungen (German).
Prerequisites
- The BC server instance uses the credential type NavUserPassword or AccessControlService. Only these types let the web services accept a user name and password.
- The web services are reachable over HTTPS (SSL). With this method, the credentials travel with every request.
- The OData port of the server instance (often 7048) is reachable from the BREEZE system.
- API services are enabled on the server instance, see Besonderheiten bei BC onPrem (German).
Setup in Business Central
- Create a dedicated user for the interface. The user needs a BC user license.
- Assign the required permission sets to the user, see Permission sets.
- On the user card, in the Web Service Access section, generate a Web Service Access Key. With AccessControlService the key is required. With NavUserPassword the user's password works as well, but the key is still the better choice because it is valid for web services only and can have an expiration date.
- In the BREEZE connection, enter the user name under Benutzer and the web service access key (or the password) under Passwort, then test the connection with Verbindung Prüfen.
Other systems: OAuth 2.0 on-premises
Systems that call the Breeze Interface API directly can also authenticate on-premises with OAuth 2.0 (client credentials flow). This requires the BC server instance to be configured for Microsoft Entra ID with OpenID Connect, and the server parameter ValidAudiences must include https://api.businesscentral.dynamics.com.
The steps in Microsoft Entra ID and in Business Central are then the same as on OAuth 2.0 setup (for SaaS only). Microsoft describes the server-side prerequisites in Microsoft Learn: Using Service-to-Service (S2S) Authentication.
Recommendation
- BREEZE: a dedicated user with a web service access key, using the connection type Dynamics 365 BC (on Prem).
- Other systems: OAuth 2.0 if the server instance already runs with Microsoft Entra ID. No password is tied to the interface, and it is the method Microsoft recommends. Without Microsoft Entra ID, a dedicated user with a web service access key is the simpler option.
Microsoft lists the web service access key as deprecated in its documentation and recommends OAuth 2.0. So far it has been switched off in Business Central online only. When moving to Business Central online, authentication therefore has to change to OAuth 2.0, and in BREEZE to the connection type Dynamics 365 BC (SaaS).
Application / Usage
This describes the process from the provision of validated squeeze purchasing documents to external workflows to the posting transfer of released documents.
Breeze Interface Documents
All documents that are in the Breeze process are listed here.
Statuswerte
- WaitingForRetrieval: The document is ready and waiting to be picked up by the workflow system.
- Retrieved: The document was picked up by the workflow.
- Processed: The document was processed successfully.
- Error: The document has at least one error, which must be corrected in the workflow.
- Rejected: The document was marked as rejected by the workflow system.
- WaitingForJson: The document is waiting for the Json file to be enriched.
- ChangeCompany: The document is waiting to be processed by the background process and transferred to another client.
Transfer to the unposted purchasing documents
After the workflow system has released the purchasing document, it is transferred to the Breeze interface. A plausibility check is then performed in the interface. If the check is successful, an unposted purchasing document is created.
If the plausibility check failed, the document is set to the status "error" and the error message is appended to the respective position in the Json structure of the document. Now the document is again waiting to be picked up and corrected by the workflow.
The unposted purchase document is created with all data from the Json structure. If attachments from the process have been attached, these will also be transferred to the unposted document.
Responsibility center and VAT business posting group
If the document header contains responsibilityCenter (responsibility center) and vatBusPostingGroup (VAT business posting group), they are applied to the unposted purchasing document: both on invoices and credit memos, the VAT business posting group on purchase orders (purchase orders already took over the responsibility center). A blank value keeps the default Business Central sets from the vendor or the user setup. The VAT business posting group of the header is the default for the lines; a group given on a line takes precedence.
The plausibility check reports
- a responsibility center or VAT business posting group that does not exist in the system,
- a responsibility center that the user under which the Breeze Interface processes the document may not use on purchase documents according to the user setup (or the company information).
Order confirmations do not change either field on the existing order.
Breeze Interface API
Here you will find the documentation for the following products:
BC-side API
In addition to the interfaces documented above, the Breeze Interface publishes the following web services on the Business Central side. They are used by the external system to exchange documents, attachments and status information.
Breeze Documents API
OData API (entity set breezedocumentsapi) over the Breeze Document table. It is used to create and read Breeze documents in Business Central.
Breeze Attachments API
OData API (entity set breezeattachmentsapi) for the attachments of a Breeze document. The file content is transferred through the dataAsBase64 field, which is used for both uploading and downloading the attachment as a Base64-encoded string.
GetDocumentStatus
Status callback exposed as a web service. The external system polls this endpoint to retrieve the current status of a document (for example whether the resulting purchase document has been created, posted, closed, deleted or cancelled).
Read-only lookup web services
The following read-only pages are published as web services so that the external system can look up master and reference data:
- Bin List
- GL Setup Dimensions
- Orderdata Purchase Lines
- Posted Purchase Rcpt. Lines
Extension Development
This chapter lists important integration events and examples that help in developing an extension for BREEZE Interface for BC.
Important:
Customizations may only be performed by appropriately trained consultants/developers. Furthermore, these are always outside of the standard support.
Guide to implementing customized document creation
Overview
This documentation provides guidance on implementing custom document creation processes using the Integration Event OnDocumentCreation in the DEXPRO Core Framework. While the default implementation creates purchase documents (Tables 38, 39), this guide shows you how to implement your own document creation logic using the provided JSON data.
Requirements
The following setting must be made in the document class setup before validating a document:
- Next process step: Breeze Interface
- Target Template: None
Have you validated a document with the DEXPRO Squeeze app and transferred it to the next process step, Breeze Interface? If so, you will now see it in Breeze Interface in a waiting status (WaitingForRetrieval). At this point, you have the option of transferring the validated document to an approval workflow so that it can be reported back after approval and transferred to the target document creation process. Further information on the Breeze Interface API can be found here.
Once you have changed the status of the Breeze receipt to "Processed", it will be reported to the DEXPRO Core for further processing—this is the integration point where you need to start.
Integration point
The central integration point is the OnDocumentCreation event in Codeunit 70954599 “DXP Doc. Creation Def. Impl.” in the DEXPRO Core app. This event is triggered during document processing and enables the implementation of custom document creation logic.
Event Signature
[IntegrationEvent(false, false)]
local procedure OnDocumentCreation(JObject: JsonObject; var CreatedDocumentRecordId: RecordId)
Parameter
JObject: Contains the complete JSON data with the document informationCreatedDocumentRecordId: Must be set with the RecordId of the created document
Implementation Guide
Step 1: Create Subscriber-Codeunit
First, create a codeunit that subscribes to the OnDocumentCreation event:
codeunit 50100 "Custom Document Creation"
{
[EventSubscriber(ObjectType::Codeunit, Codeunit::"DXP Doc. Creation Def. Impl.", 'OnDocumentCreation', '', false, false)]
local procedure OnDocumentCreation(JObject: JsonObject; var CreatedDocumentRecordId: RecordId)
begin
// Your implementation here
CreateCustomDocument(JObject, CreatedDocumentRecordId);
end;
}
Step 2: Implement document creation logic
Here is an example of how to implement custom document creation:
local procedure CreateCustomDocument(JObject: JsonObject; var CreatedDocumentRecordId: RecordId)
var
CustomHeader: Record "Custom Document Header";
CustomLine: Record "Custom Document Line";
JsonHelper: Codeunit "DXP Json Helper";
HeaderJObject: JsonObject;
LinesJArray: JsonArray;
LineJToken: JsonToken;
LineNo: Integer;
begin
// 1. Create Header
CustomHeader.Init();
CustomHeader."Document Type" := GetDocumentType(JObject);
CustomHeader."Vendor No." := CopyStr(JsonHelper.ValAsTxt(JObject, 'vendorNo', true), 1, MaxStrLen(CustomHeader."Vendor No."));
CustomHeader."Document Date" := JsonHelper.ValAsDate(JObject, 'docDate', true);
CustomHeader."Posting Date" := JsonHelper.ValAsDate(JObject, 'postingDate', true);
CustomHeader."Document Reference" := CopyStr(JsonHelper.ValAsTxt(JObject, 'docReference', true), 1, MaxStrLen(CustomHeader."Document Reference"));
CustomHeader.Insert(true);
// 2. Process Lines
LinesJArray := JsonHelper.ReadJArrayFromObj(JObject, 'lines');
LineNo := 10000;
foreach LineJToken in LinesJArray do begin
CustomLine.Init();
CustomLine."Document No." := CustomHeader."No.";
CustomLine."Line No." := LineNo;
CustomLine."Item No." := CopyStr(JsonHelper.ValAsTxt(LineJToken.AsObject(), 'no', true), 1, MaxStrLen(CustomLine."Item No."));
CustomLine.Quantity := JsonHelper.ValAsDec(LineJToken.AsObject(), 'qty', true);
CustomLine."Unit Price" := JsonHelper.ValAsDec(LineJToken.AsObject(), 'unitPrice', true);
CustomLine.Insert(true);
LineNo += 10000;
end;
CreatedDocumentRecordId := CustomHeader.RecordId;
end;
JSON-Structure
The JSON input follows this structure:
{
"type":"Invoice",
"vendorNo":"K00170",
"iban":"DE58520503530052599766",
"vatRegNo":"DE540026784",
"barcode":"123456789",
"docDate":"2023-07-13",
"serviceDate":"2023-07-13",
"postingDate":"2025-01-23",
"postingDesc":"Die ist eine Buchungsbeschreibung.",
"docReference":"R308154",
"orderNo":"B23106029",
"netAmount":7894.71,
"netAmount2":0.0,
"netAmount3":0.0,
"taxRate":19.0,
"taxRate2":0.0,
"taxRate3":0.0,
"taxAmount":1499.99,
"taxAmount2":0.0,
"taxAmount3":0.0,
"totalAmount":9394.7,
"currency":"EUR",
"assignedTo":"BERND.FEDDERSEN",
"note":"Die ist eine Bemerkung!",
"dimensions":{
"ABTEILUNG":"PROD",
"EINKÄUFER":"BF",
"KOSTENTRÄGER":"IT"
},
"dimensionSetID":27,
"customFields":{
"docClass":"DXP Invoice / Credit Memo",
"namesAndValues":[
{
"name":"Customer_No",
"value":"01121212"
},
{
"name":"Custom_Date",
"value":"2025-01-26"
}
]
},
"orderMatchDifference":"false",
"lines":[
{
"orderNo":"B23106029",
"orderLineNo":10000,
"receiptNo":"ELIEF107004",
"receiptLineNo":10000,
"vendorItemNo":"",
"type":"Item",
"no":"90002",
"description":"JogiTek G 1337 Gaming-Headset",
"qty":17.0,
"uom":"STÜCK",
"unitPrice":99.99,
"lineDisc":0.0,
"netAmount":1699.83,
"totalAmount":2022.8,
"taxRate":19.0,
"vatBusPostingGroup":"INLAND",
"vatProdPostingGroup":"MWST.19",
"dimensions":{
"ABTEILUNG":"PROD",
"BEREICH":"30",
"EINKÄUFER":"BF",
"KOSTENTRÄGER":"IT",
"VERKAUFSKAMPAGNE":"WINTER"
},
"dimensionSetID":53,
"genProdPostingGroup":"HANDEL",
"genBusPostingGroup":"INLAND",
"deferralCode":"",
"quantityDifference":"false",
"unitPriceDifference":"false",
"discountDifference":"false",
"receiptDateDifference":"false",
"customFields":{
"docClass":"DXP Invoice / Credit Memo",
"namesAndValues":[
{
"name":"Custom_Field_1",
"value":"Text in Zeile 10000"
},
{
"name":"Custom_Field_2",
"value":"2025-01-31"
}
]
}
},
{
"orderNo":"B23106029",
"orderLineNo":30000,
"receiptNo":"ELIEF107004",
"receiptLineNo":30000,
"vendorItemNo":"",
"type":"Item",
"no":"90005",
"description":"Sumsing Galaxy 23",
"qty":12.0,
"uom":"STÜCK",
"unitPrice":349.99,
"lineDisc":0.0,
"netAmount":4199.88,
"totalAmount":4997.86,
"taxRate":19.0,
"vatBusPostingGroup":"INLAND",
"vatProdPostingGroup":"MWST.19",
"dimensions":{
"ABTEILUNG":"PROD",
"BEREICH":"50",
"EINKÄUFER":"BF",
"KOSTENTRÄGER":"IT",
"VERKAUFSKAMPAGNE":"WINTER"
},
"dimensionSetID":55,
"genProdPostingGroup":"HANDEL",
"genBusPostingGroup":"INLAND",
"deferralCode":"",
"quantityDifference":"false",
"unitPriceDifference":"false",
"discountDifference":"false",
"receiptDateDifference":"false",
"customFields":{
"docClass":"DXP Invoice / Credit Memo",
"namesAndValues":[
{
"name":"Custom_Field_1",
"value":"Text in Zeile 20000"
},
{
"name":"Custom_Field_2",
"value":"2025-01-30"
}
]
}
},
{
"orderNo":"B23106029",
"orderLineNo":20000,
"receiptNo":"ELIEF107004",
"receiptLineNo":20000,
"vendorItemNo":"",
"type":"Item",
"no":"90000",
"description":"Y-Phone Ultra Pro 23",
"qty":5.0,
"uom":"STÜCK",
"unitPrice":399.0,
"lineDisc":0.0,
"netAmount":1995.0,
"totalAmount":2374.05,
"taxRate":19.0,
"vatBusPostingGroup":"INLAND",
"vatProdPostingGroup":"MWST.19",
"dimensions":{
"ABTEILUNG":"PROD",
"BEREICH":"70",
"EINKÄUFER":"BF",
"KOSTENTRÄGER":"IT",
"VERKÄUFER":"JH",
"VERKAUFSKAMPAGNE":"WINTER"
},
"dimensionSetID":58,
"genProdPostingGroup":"HANDEL",
"genBusPostingGroup":"INLAND",
"deferralCode":"",
"quantityDifference":"false",
"unitPriceDifference":"false",
"discountDifference":"false",
"receiptDateDifference":"false",
"customFields":{
"docClass":"DXP Invoice / Credit Memo",
"namesAndValues":[
{
"name":"Custom_Field_1",
"value":"Text in Zeile 30000"
},
{
"name":"Custom_Field_2",
"value":"2025-01-29"
}
]
}
}
]
}
Best practice
- Error handling: Implement proper error handling for JSON parsing and database operations:
local procedure CreateCustomDocument(JObject: JsonObject; var CreatedDocumentRecordId: RecordId)
var
CustomHeader: Record "Custom Document Header";
begin
if not DoesJsonHaveRequiredFields(JObject) then
Error('Required fields are missing in the JSON payload');
if not TryCreateCustomHeader(JObject, CustomHeader) then
Error('Failed to create document header');
// ... rest of the implementation
end;
- Validation: Implement proper validation before document creation:
local procedure ValidateDocument(JObject: JsonObject): Boolean
var
Vendor: Record Vendor;
VendorNo: Code[20];
begin
VendorNo := CopyStr(JsonHelper.ValAsTxt(JObject, 'vendorNo', true), 1, MaxStrLen(VendorNo));
if not Vendor.Get(VendorNo) then
Error('Vendor %1 does not exist', VendorNo);
// Add more validation as needed
exit(true);
end;
Common scenarios
Scenario 1: Create different document types
local procedure GetDocumentType(JObject: JsonObject): Enum "Custom Document Type"
var
DocType: Text;
begin
DocType := JsonHelper.ValAsTxt(JObject, 'type', true);
case DocType of
'Invoice':
exit("Custom Document Type"::Invoice);
'CreditMemo':
exit("Custom Document Type"::"Credit Memo");
else
Error('Unknown document type: %1', DocType);
end;
end;
Scenario 2: Processing custom fields
local procedure ProcessCustomFields(JObject: JsonObject; var CustomDoc: Record "Custom Document Header")
var
CustomFieldsObj: JsonObject;
CustomFieldsArr: JsonArray;
FieldToken: JsonToken;
begin
if not JsonHelper.TokenExists(JObject, 'customFields') then
exit;
CustomFieldsObj := JsonHelper.ReadJObjectFromObj(JObject, 'customFields');
CustomFieldsArr := JsonHelper.ReadJArrayFromObj(CustomFieldsObj, 'namesAndValues');
foreach FieldToken in CustomFieldsArr do
ProcessCustomField(FieldToken.AsObject(), CustomDoc);
end;
Troubleshooting
- RecordId is empty: Ensure that you set the CreatedDocumentRecordId parameter:
CreatedDocumentRecordId := CustomHeader.RecordId;
- JSON-Parsing-Error: Use the JsonHelper functions for secure parsing:
if not JsonHelper.TokenExists(JObject, 'vendorNo') then
Error('Vendor number is missing in JSON');
- Data validation: Implement proper data validation:
if JsonHelper.ValAsDec(LineJToken.AsObject(), 'qty', true) <= 0 then
Error('Quantity must be greater than 0');
Developing a Custom Target Template
This page is for developers and partners who want to extend Breeze Interface with a custom target template. It uses one worked example – an invoice that references a purchase order – to show how a document is given a target template other than the configured default, and which processing runs when the document is set to Processed.
The example: an invoice arrives through Squeeze and is validated as usual. If the document header carries a purchase order number, a purchase invoice should not be created as it would be by default. Instead, the purchase order referenced in the header is to be posted.
Which approach is the right one?
There are two ways to implement your own document creation. They are mutually exclusive – pick the right one before you start:
| Custom target template (this page) | OnDocumentCreation event | |
|---|---|---|
| Target template setting | your own target template | None |
| Validation by Breeze | yes, with the switches from the target template setup | no |
| Several document types side by side | yes, one target template per case | a single implementation for all documents |
| Suited for | handling standard purchasing documents differently – such as posting a purchase order instead of creating an invoice | writing documents into entirely custom tables |
If you want to write into your own tables and do not need Breeze's validation, follow the page Guide to implementing customized document creation instead. That approach does not fit the example described here: it requires the target template None and therefore bypasses exactly the validation an invoice with an order reference needs.
The standard flow
A document passes these stations on its way from Squeeze to the target document in Business Central:
- Squeeze hands the document to Core. Core creates a record in the
DXP Documenttable. - Core uses the document class (
DXP Document Class) to determine the next process step. If that step is Breeze Interface, a Breeze document (DXP BRZ IF Document) is created. - On creation, the Breeze document receives its target template from the document class setup – the Target Template field on the Document Class Setup page.
- The document is handled in the external workflow and returns with status Processed.
- Breeze Interface then invokes the implementation registered for that target template. It validates the document and hands it to Core, which creates the target document.
Technically, the target template is an enum implementing an interface:
DXP Breeze IF Target Template– the target template enum,Extensible = true.DXP BRZIF IDocument Processing– the interface every target template implements. It has exactly one method:procedure ProcessDocument(var BREEZEDoc: Record "DXP BRZ IF Document"; JObject: JsonObject)
These target templates ship with the app:
| Value | Target template | Implementation |
|---|---|---|
| 0 | None | DXP BRZ Default Processing |
| 1 | Purchase Document | DXP BRZ IF PInv/Crdt Memo Proc |
| 2 | Purchase Order | DXP BRZ IF Purch. Order Proc. |
| 3 | Order Confirmation | DXP BRZ IF Order Conf. Proc. |
| 4 | Delivery Note | DXP BRZ IF Del. Note Proc. |
{add screenshot of Document Class Setup here}
Prerequisites
- Your own extension with a dependency on DEXPRO Breeze Interface (app id
7c431886-108e-44c3-9328-30e2b93edfa6) and – carried along throughpropagateDependencies– on DEXPRO Core. - Your own object id range. Do not use the range of Breeze Interface (70954950–70954969) or Core (70954575–70954624).
- Your own object name affix as required by your
AppSourceCop.json.
Never use the DXP affix for your own objects – it is reserved for the DEXPRO apps. In the code samples on this page, XYZ stands for your own affix.
Step 1 – Register the target template as an enum extension
The DXP Breeze IF Target Template enum is extensible. Add a value and point Implementation at your own codeunit:
enumextension 50100 "XYZ Target Template Ext." extends "DXP Breeze IF Target Template"
{
value(50100; "XYZ Post Purchase Order")
{
Caption = 'Post Purchase Order';
Implementation = "DXP BRZIF IDocument Processing" = "XYZ Post Purch. Order Proc.";
}
}
The enum value is stored on both the Breeze document and the Core document. Do not change the number once the extension is in production – documents already stored would then point at a different target template.
Step 2 – Override the default target template
The target template is read from the document class setup when the Breeze document is created. To override it conditionally, subscribe to the OnAfterFillDocumentInfo event of codeunit DXP BRZ IF Document Mgt.. It is raised while the Breeze document is being populated from the JSON – that is, before it is inserted:
codeunit 50100 "XYZ Breeze Doc. Subscribers"
{
[EventSubscriber(ObjectType::Codeunit, Codeunit::"DXP BRZ IF Document Mgt.", 'OnAfterFillDocumentInfo', '', false, false)]
local procedure SetTargetTemplateOnOrderReference(var BrzIfDoc: Record "DXP BRZ IF Document"; JsonData: JsonObject)
var
CoreTokenMgt: Codeunit "DXP Core Token Mgt.";
JsonHelper: Codeunit "DXP Json Helper";
OrderNo: Code[20];
begin
// Only redirect documents that would default to a purchase invoice.
if BrzIfDoc."Target Template" <> BrzIfDoc."Target Template"::"Purchase Document" then
exit;
OrderNo := CopyStr(JsonHelper.ValAsTxt(JsonData, CoreTokenMgt.GetOrderNoTok(), false), 1, MaxStrLen(OrderNo));
if OrderNo = '' then
exit;
BrzIfDoc."Target Template" := BrzIfDoc."Target Template"::"XYZ Post Purchase Order";
end;
}
The purchase order number sits in the header JSON under the orderNo token. Always read it through DXP Core Token Mgt. – the token names are maintained centrally there.
The second argument of ValAsTxt is EnsureSuccess. Pass false here: the order number is an optional field, and with true a missing token would raise a runtime error.
Keeping the Core document in sync
Core keeps a copy of the target template in the Breeze Interface Target Template field of the DXP Document table. When your subscriber changes the target template, update that field as well – otherwise the Core document still shows the old template. The processing from step 3 takes care of it (see CoreDoc.Validate("DXP Breeze IF Target Template", ...) in the sample below).
Step 3 – Implement the processing
When the Breeze document is set to Processed, Breeze Interface invokes the implementation registered for its target template:
IDocumentProcessing := Rec."Target Template";
IDocumentProcessing.ProcessDocument(Rec, JsonHelper.JObjectFromBlob(Rec.RecordId, Rec.FieldNo(JSON)));
Your codeunit implements DXP BRZIF IDocument Processing for this. It is responsible for:
- Validating the document – on failure, set the Breeze document to status Error and write the messages into the JSON.
- Handing over to Core through
DXP Document Mgt.UpdateDocumentwhen the document is valid. - Deleting the Breeze document after a successful handover. The Core document remains as the record of the transaction.
codeunit 50101 "XYZ Post Purch. Order Proc." implements "DXP BRZIF IDocument Processing"
{
procedure ProcessDocument(var BREEZEDoc: Record "DXP BRZ IF Document"; JObject: JsonObject)
var
CoreDoc: Record "DXP Document";
CoreDocMgt: Codeunit "DXP Document Mgt.";
ValidDoc: Boolean;
begin
ValidDoc := CheckDocument(JObject);
if not ValidDoc then begin
BREEZEDoc.Validate(Status, "DXP Breeze IF Status"::Error);
BREEZEDoc.Modify(false);
exit;
end;
CoreDocMgt.UpdateDocument(
BREEZEDoc."Core Document No.",
"DXP Document Status"::Transferred,
"DXP Target Document Process"::"XYZ Post Purchase Order",
JObject);
CoreDoc.Get(BREEZEDoc."Core Document No.");
CoreDoc.Validate("DXP Breeze IF Target Template", BREEZEDoc."Target Template");
CoreDoc.Modify(true);
BREEZEDoc.Delete(true);
end;
}
Use the shipped codeunit DXP BRZ IF PInv/Crdt Memo Proc as the model for your validation. Use DXP Plausiblity Check Mgt. for the checks themselves, and DXP BRZ IF Target Templ. Mgt. to read your template's setup – that way the Disable Amounts Check and Disable Posting Date Check switches apply to your template too.
Step 4 – Create the target document in Core
The target template in Breeze decides which validation runs. Which target document is created is decided by a second enum in Core: DXP Target Document Process, also Extensible = true, with the interface DXP IDocument Processing.
The two enums are separate and both need extending. The Breeze target template selects the validation; the Core target document process selects the document creation. The value is passed to UpdateDocument by your processing from step 3.
enumextension 50101 "XYZ Target Doc. Process Ext." extends "DXP Target Document Process"
{
value(50100; "XYZ Post Purchase Order")
{
Caption = 'Post Purchase Order';
Implementation = "DXP IDocument Processing" = "XYZ Post P. Order Creation";
}
}
The DXP IDocument Processing interface has a single method returning the RecordId of the created document. Core stores it in the Linked-to Record Id field of the Core document:
procedure ProcessStandardDocument(JObject: JsonObject): RecordId
Your implementation reads the order number from the header, retrieves the purchase order and posts it:
codeunit 50102 "XYZ Post P. Order Creation" implements "DXP IDocument Processing"
{
procedure ProcessStandardDocument(JObject: JsonObject): RecordId
var
PurchaseHeader: Record "Purchase Header";
PurchInvHeader: Record "Purch. Inv. Header";
CoreTokenMgt: Codeunit "DXP Core Token Mgt.";
JsonHelper: Codeunit "DXP Json Helper";
TargetDocumentMgt: Codeunit "DXP Target Document Mgt.";
PurchPost: Codeunit "Purch.-Post";
DocRecRef: RecordRef;
OrderNo: Code[20];
VendorNo: Code[20];
begin
OrderNo := CopyStr(JsonHelper.ValAsTxt(JObject, CoreTokenMgt.GetOrderNoTok(), true), 1, MaxStrLen(OrderNo));
VendorNo := CopyStr(JsonHelper.ValAsTxt(JObject, CoreTokenMgt.GetVendorNoTok(), true), 1, MaxStrLen(VendorNo));
PurchaseHeader.SetRange("Document Type", PurchaseHeader."Document Type"::Order);
PurchaseHeader.SetRange("No.", OrderNo);
PurchaseHeader.SetRange("Buy-from Vendor No.", VendorNo);
PurchaseHeader.FindFirst();
// Transfer the invoice data from the JSON onto the purchase order
// (document date, posting date, vendor invoice no., quantities to invoice)
UpdatePurchaseHeaderFromJson(JObject, PurchaseHeader);
PurchPost.SetSuppressCommit(true);
PurchPost.Run(PurchaseHeader);
DocRecRef.Get(PurchaseHeader.RecordId());
TargetDocumentMgt.SetProcessedCompletely(DocRecRef);
PurchInvHeader.SetRange("Order No.", OrderNo);
if PurchInvHeader.FindLast() then
exit(PurchInvHeader.RecordId());
exit(PurchaseHeader.RecordId());
end;
}
Never return an empty RecordId. Core checks the return value; if it is empty, processing stops with an error.
Marking the document as completely processed
Core extends the Purchase Header table with a Completely Processed field. Set it through DXP Target Document Mgt.SetProcessedCompletely once the document has been fully handled. The shipped implementations do the same; the field drives the display and downstream processing.
What happens when the order is posted
Posting creates a new document – the posted purchase invoice – while the purchase order is deleted or kept depending on the remaining quantities. Return the posted document, as shown above. If Linked-to Record Id points at a deleted purchase order, the drill-down from the Core document leads nowhere.
Target template setup
Every target template has a record in the DXP BRZ IF Target Templ. Setup table, shown on the Target Template Setup page. It is created automatically on first access. These switches are available:
- Disable Amounts Check – suppresses the reconciliation of header and line amounts.
- Disable Posting Date Check – suppresses the posting date validation.
- Ignore Vendor Blocked (Payment) – allows documents for blocked vendors.
- Do not release – suppresses the automatic release of the target document.
If your target template needs defaults other than the empty standard values, set them on creation. Codeunit DXP BRZ IF Target Templ. Mgt. does this for the shipped templates; for your own, subscribe to the table's OnInsert trigger.
{add screenshot of Target Template Setup here}
Checklist
| Step | Object | Purpose |
|---|---|---|
| 1 | enumextension on DXP Breeze IF Target Template | Register your target template |
| 2 | Subscriber on OnAfterFillDocumentInfo | Override the default target template conditionally |
| 3 | codeunit implements DXP BRZIF IDocument Processing | Validate and hand over to Core |
| 4 | enumextension on DXP Target Document Process | Register your target document process |
| 5 | codeunit implements DXP IDocument Processing | Create the target document – here: post the purchase order |
| 6 | Document Class Setup | Confirm the next process step is set to Breeze Interface |
Troubleshooting
| Symptom | Cause |
|---|---|
| The document keeps the old target template. | The subscriber from step 2 is not taking effect. Check that the document class really points at the Purchase Document target template and that the orderNo token is populated in the header JSON. |
| Setting the document to Processed runs the default processing. | The Implementation reference is missing from the enum value. Without it the enum's DefaultImplementation applies, which is DXP BRZ Default Processing. |
| Error Document creation failed. RecordId is empty. | Your ProcessStandardDocument implementation returned no RecordId. |
| The drill-down from the Core document opens nothing. | Linked-to Record Id points at a deleted document – return the posted document, not the purchase order. |
| The document sits in Error with no message shown. | Your processing sets the status but writes no validation messages into the JSON. Use DXP Document Transfer Mgt.AddErrorsToJson. |
Related topics
- Target Template Setup – the switches per target template
- Document Class Setup – mapping document class, next process step and target template
- Breeze Interface Documents – the document list and its statuses
- Guide to implementing customized document creation – the alternative approach through
OnDocumentCreationfor custom document tables - Breeze Interface API – returning the document from the external workflow