Overview
Verify the state of ERP transactions rather than assuming a successful API request completes the accounting process.
Dynamics 365 F&O · Power Automate · OData REST APIs
- Journal batch lookup
- Posted and unposted status
- Debit and credit reconciliation
- Company-aware monitoring
- Retries
- Exception handling
Standard data entities
VendInvoiceJournalHeaders
VendInvoiceJournalHeaders is a candidate collection. Confirm the collection, keys, status and amount fields in the target environment before use.
Architecture
- Company and batch identifier
- Header lookup
- Evaluate posted status and debit-credit difference
- Route exceptions for review
Scenarios
- State verification
- Compare posted, unposted, unbalanced and missing journal cases before retrying.
Illustrative API reference
Confirm the entity sets, fields, keys, enums, permissions and supported operations against /data/$metadata in an authorized demo environment before using these examples.
Journal header lookup pattern after metadata verification
GET https://<environment>/data/<verified-entity-set>
?$filter=JournalBatchNumber eq 'DEMO-000001' and dataAreaId eq 'DEMO'
&$select=JournalBatchNumber,JournalName,IsPosted,JournalTotalDebit,JournalTotalCredit,dataAreaId
&cross-company=true Illustrative response
{
"value": [
{
"dataAreaId": "DEMO",
"JournalBatchNumber": "DEMO-000001",
"JournalName": "DEMO-JV",
"IsPosted": "No",
"JournalTotalDebit": 25000,
"JournalTotalCredit": 25000
}
]
} Fictional dataset
The fixture includes posted and unposted headers and an unbalanced journal in DEMX. An absent key returns Not found.
Preview the sample dataset
| Company | Batch number | Journal name | Status | Debit | Credit |
|---|---|---|---|---|---|
| DEMO | DEMO-000001 | DEMO-JV | Not posted | ₹25,000 | ₹25,000 |
| DEMO | DEMO-000002 | DEMO-JV | Posted | ₹15,000 | ₹15,000 |
| DEMX | DEMX-000001 | DEMX-JV | Not posted | ₹8,200 | ₹8,000 |
Illustrative SharePoint backend
D365 owns journals and their confirmed state. Use SharePoint to route checks and capture observed results.
These proposed schemas use logical internal names. Confirm names, choice and person values, and connector delegation in your tenant. Sample references are fictional identifiers.
Download SharePoint schemas and examplesJournalMonitoringRequests · List
| Internal column name | Field type | Index and key |
|---|---|---|
| Title | Single-line text | — |
| RequestID | Single-line text | Unique and indexed |
| Company | Single-line text | Candidate index |
| JournalBatchNumber | Single-line text | Candidate index |
| Status | Choice | — |
| LastCheck | Date and time (UTC) | — |
JournalStatusLogs · List
| Internal column name | Field type | Index and key |
|---|---|---|
| Title | Single-line text | — |
| EventID | Single-line text | Unique and indexed |
| RequestID | Single-line text | Candidate index |
| ActualStatus | Choice | — |
| CheckedOn | Date and time (UTC) | — |
| Error | Multiple lines of text | — |
Read an operational list
GET https://<tenant>.sharepoint.com/sites/Demo/_api/web/lists/getbytitle('JournalMonitoringRequests')/items
?$select=RequestID,Company,JournalBatchNumber,Status
&$filter=Company eq 'DEMO-A' Use indexed, delegable filters and pagination. The 5,000-item List View Threshold applies to affected queries. Use stable unique keys, concurrency controls, version history and separate execution logs.
Enforce least privilege directly on lists, libraries and integration identities. Keep sensitive values out of general history and use restricted libraries for supporting documents. Review retention, archiving and any ERP or connector licensing in the target environment.
A Power Automate flow can retrieve the relevant records, validate them, request approval when required, prepare the payload, use documented authorized integration where available, verify the ERP result, update the request and log the outcome.
Implementation pattern
Use company and batch together to locate a journal. Reconcile amounts and resolve uncertain submission state before taking further action.
Try the demo
Fictional data · Runs locally in your browser
Try DEMO-000001 for Not posted, DEMO-000002 for Posted, or DEMX-000001 under DEMX for an imbalance.
DEMO-000001 · Not posted · Debit-credit difference ₹0
- Debit
- ₹25,000
- Credit
- ₹25,000
Validation
Confirm the entity, response shape and status representation against authorized metadata. A balanced journal still needs validity checks and a separate posted-state check.
Documentation
All projects published on this website are independent educational demonstrations based on standard Microsoft Dynamics 365 Finance & Operations data entities and publicly documented APIs. All datasets, company identifiers, account codes, transaction references and financial amounts are fictional. No proprietary code, confidential business information or organizational data is reproduced. Entity availability, field definitions, permissions and supported operations may vary by application version and environment configuration.