MSBA-273 · Lesson 12 of 12 · 22 min

Case study: syncing with an ERP system

▶ Video coming soon A video version of this lesson is on the way.

The last session was a design review, run the way Rupert ran every review: requirements first, then options, then a recommended design, then risks, tests and a decision record. The subject was the request that had started the series. Facilities and accounts payable exchanged a spreadsheet every week. Facilities sent a list of contractor work it had approved for payment, with work-order numbers and amounts; accounts payable sent back supplier changes and the payment status of earlier invoices. Somebody retyped each side into the other system. Ysaline Dabrowski, the accounts payable supervisor, and Delphine Okoro-Vance, the Facilities business owner, wanted the exchange automated. Signe and Wiremu presented a design for syncing the Facilities Work Orders solution with LedgerPoint, the college's finance system. Everything in this lesson is a plan; nothing had been built when the series ended.

The systems

LedgerPoint is an older Windows finance system that serves as Lumenvale's enterprise resource planning system for finance: suppliers, purchase orders, invoices and payments. It has two integration surfaces and an important gap. A read-only reporting API exposes suppliers, purchase orders, invoices and payment status; Signe had wrapped it earlier as a custom connector, with the API key in Azure Key Vault. Invoice entry, however, is possible only through the Windows client. LedgerPoint has no API for creating invoices, and the vendor had no plans to add one. Accounts payable already used an unattended desktop flow, running on a dedicated machine, to enter a different set of routine invoices through the client.

On the Dataverse side, the Facilities Work Orders solution held work orders, their cost lines and the contractors who did the work, stored as suppliers. Each cost line had an approval status set by Facilities supervisors.

The proposed design. From LedgerPoint, a nightly function reads suppliers and invoice status through the read-only reporting API and upserts them into Dataverse supplier and invoice status tables. From Dataverse, approved cost lines are placed in an outbound payment request table; an unattended desktop flow enters each as an invoice in the LedgerPoint Windows client and records the invoice number; the next nightly read confirms it. A reconciliation report compares both sides weekly. A banner reads design proposal.
The proposed LedgerPoint integration: two one-way flows and a confirmation loop.

Requirements

Signe had gathered the requirements in two working sessions with Ysaline and Delphine. She wrote them as testable statements and gave each a number so that the design could refer to them.

Requirements for the LedgerPoint integration.
NumberRequirementOwner
R1Supplier legal name, supplier number, status and payment terms in Dataverse match LedgerPoint by the start of each working dayYsaline
R2Facilities can request a same-day refresh of one supplierDelphine
R3Approved contractor costs reach LedgerPoint as invoices without retypingYsaline and Delphine
R4No cost line is ever entered as an invoice twiceYsaline
R5Each work order shows the payment status of its invoices, at most one working day oldDelphine
R6Accounts payable can reconcile both systems weekly without IT helpYsaline
R7No banking details or personal information about contractors' staff leave LedgerPointDr. Ondaatje-Ruiz

Ownership and patterns

The first design decision applied Lesson 6: each piece of data gets one system of record, and the integration becomes one-way flows. LedgerPoint owns supplier identity and terms, invoices and payments. Dataverse owns work orders, cost lines and their approval. Two flows follow. Supplier and invoice status data broadcast from LedgerPoint to Dataverse. Approved costs broadcast from Dataverse to LedgerPoint as invoices. Nothing is edited in both systems. Facilities-only supplier details, such as trade categories and campus contacts, stay in Dataverse and are never sent back.

R7 shaped the inbound data. The reporting API returned bank account details for each supplier, because LedgerPoint's own reports needed them. The design's mapping selected only the columns in R1, so bank details never left LedgerPoint, and the custom connector's definition was narrowed to omit them from the response schema.

Inbound: suppliers and invoice status

The inbound options were the ones the series had covered. A virtual table, through a custom provider over the reporting API, would give live data without a copy. A nightly copy into standard tables would give fast, dependable access at the cost of being up to a day old. Signe had timed the reporting API after the fifth session and found that a single supplier lookup took two to four seconds, and that the API was occasionally unavailable during LedgerPoint's nightly processing. A virtual table would make supplier forms and lookups slow and occasionally broken. The nightly copy met R1 and R5, so the design chose it, with R2 met by an on-demand refresh of one supplier.

Inbound options compared.
OptionMeets R1 and R5User experienceDependence on LedgerPoint availabilityChoice
Virtual table over the reporting APIYes, liveTwo to four seconds per lookupHigh: every form loadRejected
Nightly copy, full readYesFastOnly during the jobRejected: reads all suppliers every night
Nightly copy, changes onlyYesFastOnly during the jobChosen, plus on-demand refresh

The nightly job would be an Azure Function on a timer, running at 5:00 after LedgerPoint's nightly processing finished. It would authenticate to Dataverse with a managed identity linked to an application user, and to the reporting API with the key from Key Vault read through the same managed identity. It would ask the reporting API for suppliers and invoices changed since the last successful run, using the API's changed-since parameter, keeping the last successful run time in the Integration Run table from Lesson 10. Writes would use UpsertMultiple on the supplier number and invoice number alternate keys, in configurable batches, as Lesson 7 described. Suppliers removed or deactivated in LedgerPoint would be deactivated in Dataverse, keeping the history that old work orders referred to.

The on-demand refresh for R2 would be a custom API, lcc_RefreshSupplier, callable from a command button on the supplier form by Facilities supervisors. Behind it, a plug-in could not call the reporting API synchronously within acceptable time, so the custom API would place a request on a Service Bus queue and return at once; a function would perform the refresh within a minute and update the row. Supervisors would see the refresh time on the form.

Outbound: approved costs to invoices

R3 was the hard part, because LedgerPoint offered no way to create invoices except its Windows client. The options were few. Accounts payable could keep typing invoices from a report, which met nothing. The vendor could be asked for an import file format, which Ysaline had already done without success. Or an unattended desktop flow could enter the invoices through the client, as accounts payable already did for other routine invoices. The design chose the desktop flow, with safeguards that made its known weaknesses visible and recoverable.

When a supervisor approved a cost line, a plug-in from the earlier series would create a row in a new table, Payment Request, holding the work-order number, supplier number, amount, tax code and a unique request number. The desktop flow, run on a schedule each afternoon by a cloud flow, would read pending payment requests, enter each in LedgerPoint, read the invoice number from the client's confirmation screen and write it back to the payment request with the status Entered. The next morning's inbound job would read that invoice from the reporting API and set the status to Confirmed when the amount and supplier matched.

Listing 12.1: The payment request status model and duplicate guards (a design record, not executable).
Payment Request (lcc_paymentrequest), status model
Pending     created by the approval plug-in; one row per approved cost line
InProgress  claimed by the desktop flow run, with the run identifier
Entered     invoice number captured from the LedgerPoint client
Confirmed   next nightly read found the invoice with matching supplier and amount
Exception   any mismatch or failure; owner notified, never retried automatically

Guards
- Alternate key on the cost line: one payment request per cost line (R4)
- The request number is typed into LedgerPoint's external reference field
- Before entering, the desktop flow searches LedgerPoint for that reference;
  if found, it records the existing invoice number and does not enter again (R4)

R4 drove most of the outbound design. User-interface automation can fail halfway: the client can freeze after saving the invoice but before the flow reads the confirmation. A naive retry would then enter the invoice twice. The guards in Listing 12.1 close that gap. Each cost line can produce only one payment request because of the alternate key. Each invoice carries the request number in LedgerPoint's external reference field. And before entering any invoice, the desktop flow searches for that reference and, if it already exists, records the existing invoice instead of creating another. Anything unexpected sets the status to Exception for a person to resolve; the design never retried a failed entry automatically.

Identities and security

Identities in the proposed design.
ComponentIdentityAccess
Nightly inbound functionManaged identityUpsert suppliers and invoice status; read and update payment requests; create integration errors
Refresh functionManaged identityUpdate one supplier at a time
Cloud flow that starts the desktop flowService account connection owned by the CoE teamRead and update payment requests
Desktop flow on the machineDedicated LedgerPoint user for invoice entryInvoice entry only, as accounts payable already approved
Reporting API keyStored in Key VaultRead by the inbound and refresh functions' identities only

The desktop flow's LedgerPoint account was the one weak point the design could not remove: LedgerPoint authenticated its client with a user name and password. The credential would live in Key Vault, be retrieved by the desktop flow at run time, and the account would be limited in LedgerPoint to invoice entry for the Facilities cost centre. Accounts payable's existing desktop flow already used the same pattern, and its machine was locked down by the infrastructure team. Dr. Ondaatje-Ruiz accepted the arrangement on condition that the account's activity in LedgerPoint was reviewed monthly.

Monitoring and reconciliation

The monitoring design applied Lesson 10. The inbound job wrote an Integration Run row each night and had a freshness alert at 26 hours. Payment requests in Entered status for more than two working days, or in Exception at all, alerted the integration owner. The desktop flow's run history and screenshots on failure were kept for thirty days. R6 was met by a weekly reconciliation view, readable by accounts payable in a model-driven app: for the week, the count and total of approved cost lines, payment requests, entered invoices and confirmed invoices, with any differences listed line by line.

Worked problem

Reading the reconciliation

In a test week the reconciliation shows 64 approved cost lines totalling 48,250 dollars, 64 payment requests, 63 entered invoices and 62 confirmed invoices totalling 47,410 dollars. What does Ysaline investigate, and what is the value at stake?

Show solution
  1. Every approved line produced a payment request, so the approval plug-in worked.
  2. One request was not entered: it is Pending or in Exception, and the desktop flow log will say which.
  3. One entered invoice was not confirmed: either the nightly read has not run since it was entered, or the amount or supplier did not match.
  4. Unconfirmed value: 48,250 minus 47,410 is 840 dollars across the two lines.

Answer: Two lines, worth 840 dollars together, need checking: one not entered and one entered but not confirmed. Everything else reconciles.

Risks

The risk register presented at the review.
RiskEffectMitigation
LedgerPoint client update changes screensDesktop flow failsTest the flow in the LedgerPoint test system before each update; failures go to Exception, not retry
Reporting API unavailable at 5:00Inbound data a day lateRetry until 7:00; freshness alert; R1 owners told
Duplicate invoice entrySupplier paid twiceAlternate key, external reference search, no automatic retry
Delta query misses changesStale suppliersWeekly full comparison of supplier counts and a monthly full refresh
Desktop flow machine unavailableInvoices delayedQueue holds requests; accounts payable can enter manually from the Exception view
Key or password exposedUnauthorized accessKey Vault, limited accounts, monthly activity review, rotation

Testing and rollout

The test plan followed the earlier series' practice: unit tests for mappings and status changes, integration tests in a test environment connected to LedgerPoint's test company, and a parallel run in which the integration ran alongside the spreadsheet process for four weeks, with accounts payable comparing the results before the spreadsheet was retired. Every first run against production data would be a dry run, as Lesson 6 recommended. The rollout would start with supplier data only, add invoice status after two clean weeks, and add outbound invoices last, because that was the part with real financial risk.

The decision

At the end of the review Rupert summarized the decision record. The approach was accepted as the preferred design: two one-way flows with LedgerPoint as the system of record for suppliers and invoices, a nightly change-based inbound job with on-demand refresh, and outbound invoice entry by an unattended desktop flow guarded against duplicates. Funding and scheduling would be decided with the January planning cycle, alongside the D4 alarm integration and the preventive maintenance work. Open items went to named owners: the LedgerPoint vendor's confirmation of the changed-since parameter's behaviour, the cost of the desktop flow licence and machine time, and accounts payable's sign-off on the reconciliation view. Delphine and Ysaline both signed the requirements; nothing would be built until the work was funded.

Wiremu said afterwards that the review had used almost every lesson of the series: the Web API and alternate keys, application identities and Key Vault, queues and functions, the choice between virtual and standard tables, integration patterns and change detection, bulk operations, a custom API, monitoring, security and privacy. That was the point. Integration is rarely one technology; it is a set of decisions about ownership, timing, identity and failure, made explicitly and written down.

Mapping the case to AB-400

The AB-400 exam's integration domain carries about 10 to 15 percent of the weight. The skills this case exercised map closely to it: choosing among the Web API, connectors and Azure services for an integration; securing integration identities; handling events with webhooks and Service Bus; and designing for limits and failures. Candidates should practise drawing a design like this one from a short scenario, naming the pattern, the system of record, the identity and the failure handling for each flow.

Common mistakes

  • MistakeDesigning a two-way supplier sync because both teams look at suppliers.

    InsteadGive each column one system of record and build one-way flows.

  • MistakeUsing a virtual table over a slow, sometimes unavailable API for data used on every form.

    InsteadCopy changes nightly and offer an on-demand refresh.

  • MistakeRetrying a failed user-interface entry automatically.

    InsteadSearch for the external reference first and send unexplained failures to a person.

  • MistakeCopying every column the source API returns.

    InsteadMap only required columns; leave banking and personal details in the source.

  • MistakeSwitching off the spreadsheet on go-live day.

    InsteadRun in parallel and reconcile before retiring the old process.

  • MistakeTreating the design review as approval to build.

    InsteadRecord the decision, owners and open items, and build only when funded.

Summary and key terms

  • The case integrates the Facilities Work Orders solution with LedgerPoint, which has a read-only reporting API and no invoice-creation API.
  • Ownership is split by data: LedgerPoint owns suppliers and invoices; Dataverse owns work orders and cost approvals.
  • Inbound data arrives nightly by change-based reads with UpsertMultiple on alternate keys, plus an on-demand refresh through a custom API and a queue.
  • Outbound invoices are entered by an unattended desktop flow, protected against duplicates by an alternate key, an external reference and a search before entry.
  • Managed identities, Key Vault, limited accounts, freshness alerts, exception alerts and a weekly reconciliation make the design secure and observable.
  • The design was accepted as the preferred approach; funding and build are later decisions.
Enterprise resource planning system
A system that manages core business processes such as finance, purchasing and payments.
Desktop flow
A Power Automate flow that automates a Windows application through its user interface.
Unattended run
A desktop flow run on a machine with no signed-in person watching.
External reference
A field in one system that holds the identifier of the matching record in another, used for matching and duplicate checks.
Parallel run
Running a new process alongside the old one and comparing results before switching over.
Decision record
A written record of a design decision, its reasons, its owners and open items.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Why did the design reject a virtual table for suppliers?

    Show answer

    The reporting API took two to four seconds per lookup and was sometimes unavailable, so forms would be slow and occasionally broken.

  2. Which three guards prevent a cost line from becoming two invoices?

    Show answer

    An alternate key on the cost line in Payment Request, the request number in LedgerPoint's external reference field, and a search for that reference before entry.

  3. How is R7 met?

    Show answer

    The mapping and the connector schema include only the required supplier columns, so banking and personal details never leave LedgerPoint.

  4. In what order would the integration be rolled out, and why?

    Show answer

    Suppliers, then invoice status, then outbound invoices, because the outbound part carries the most financial risk.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz