The Feature Everyone Loved: Inside the Credit Hold Alert

 The third article in my Finance Agent series

In the first two articles, I wrote about building my first finance agent and then splitting one overloaded agent into three focused ones.

In this article, I will cover the feature that got the biggest reaction for users. It was not a chat experience. It was a card in Teams.

When a sales order went on credit hold in Dynamics 365 Finance. A few moments later, the credit team had a concise summary, a recommendation, and links to investigate.

It looked simple. That simplicity took some design to work properly.

Quick Video


It Starts with a Finance Event

The process begins when Dynamics 365 Finance raises the configured credit-hold event. Unfortunately there is not an exposed business event for a sales order being placed on credit hold, so I had to look for another approach. Fortunately, virtual entities provided a good option. The virtual table - Credit Management (mserp_creditmantablebientity) adds a row when a new credit hold is placed. Power Automate listen to that table and when a new record is added, it parses the record and passes four pieces of context to the Sales Order Hold Agent: the hold ID, the sales order, the legal entity, and the current date.

The legal entity matters. Finance data cannot be casually combined across companies, so the agent has to verify the company context before it can make a useful assessment.

The Sales Order Hold Agent then reads a narrow set of current Finance facts: the recorded hold reason, customer credit information, open accounts receivable, aging, the oldest past-due item, order exposure, the most recent payment, and other active holds.

The Alert Is Narrow on Purpose

The agent does not research everything a collector might eventually want to know.

It intentionally leaves detailed disputes, promises to pay, collection activity history, invoice lists, open-order lists, and customer communications for the Collection Manager Agent.

That is not missing functionality. It is a performance and reliability boundary.

The automated moment needs enough verified information to help a person decide what to review next. It does not need to reproduce the entire collections workspace inside a Teams card.

One Structured Response

The agent returns one JSON object between two markers. The flow cleans the response, extracts the marked alert, parses the JSON, builds the Finance links, creates the card, and posts it as the Flow bot.

The response uses the same four recommendation values every time:

  • ESCALATE when information is missing, conflicting, or requires a person to interpret policy.

  • KEEP ON HOLD when verified current risk supports retaining the hold.

  • RELEASE WITH CONDITIONS when a verified condition should be completed first.

  • RELEASE when current verified facts support release.

Even the strongest recommendation is advisory. The agent never releases the hold. An authorized person still makes and completes that decision in Finance.

The Fallback Matters as Much as the Success Card

Structured output can fail. A response can be blank, a marker can be missing, or the JSON can be incomplete.

I did not want a parsing problem to become a misleading credit recommendation. If the response cannot be validated, the flow posts a fallback card to the same channel instead of pretending the analysis succeeded.

That fallback is a control, not just an error message. It makes the failure visible and directs the user back to the source system.

From Alert to Investigation

The card has three practical actions: open the credit hold in Finance, open the sales order, or open the Collection Manager Agent.

The last action does not pass the card values into a continuing conversation. The Collection Manager Agent performs a fresh Finance read using the business key and legal entity the user supplies.

That means the interactive review can be different from the original alert if the data has changed. The current Finance facts win.

What's Next

The alert gets attention. The next step is turning that attention into a useful collection conversation

Comments

Popular posts from this blog

Showing the last 12 months based on a date slicer

A look at Dynamics 365 ERP and ERP Analytics MCP Servers

Adding a new entity to Dual-write in Dynamics 365 Finance