Microsoft TeamsEpicor Prophet 21 Agent view

How to add Microsoft Teams to Epicor Prophet 21

Short answer

Build a Teams bot or Power Automate workflow that listens for Prophet 21 events (credit holds, PO approvals, stockouts), posts adaptive cards to the right channel or person, and sends the approve or reject decision back through the P21 APIs. Sign users in with Entra ID and map them to P21 users so approvals are attributable.

Many Prophet 21 shops already live in Microsoft 365. Managers approve things from email, credit holds sit in a P21 window until somebody notices, and buyers learn about a stockout when a customer calls. Teams is where people already are, but P21 does not push into it on its own.

The value is in turning P21 exceptions into actionable cards: an order on credit hold with the customer's balance and an approve button, a purchase order awaiting approval with line detail, or an item that dropped below its minimum at a branch. The decision is recorded in P21, not just in chat.

Because P21 is often on-premises, the main design question is how a cloud-hosted Teams service reaches an internal system safely. This page walks through that, plus the Entra ID and permission mapping that makes approvals defensible.

What teams use it for

Credit hold release

Post an order on credit hold to the credit manager with customer balance, past due amounts and the order total, with approve and decline actions.

Purchase order approval

Send POs above a threshold to the approver as an adaptive card with vendor, lines and total, and write the decision back to the approval workflow.

Branch stockout alerts

Notify the branch buyer channel when an A-class item drops below minimum at a location, with on-hand, allocated and open PO quantities.

Large order or special order heads-up

Alert purchasing and the warehouse when an order contains a non-stock or special-order line so procurement starts before the customer asks.

Order lookup from a channel

Let a salesperson type a command or ask the bot for an order, quote or customer snapshot without opening P21.

Daily exception digest

Post a morning summary of late shipments, unconfirmed POs and past due orders to the operations channel.

Epicor Prophet 21 integration surface

  • P21 middleware services for reading orders, customers, items and for submitting transactions and notes; version-dependent, so check your installed API docs and the Swagger-style catalog if enabled.
  • SQL Server read access for exception queries, for example orders with a hold flag, items below minimum by location, and POs with an approval status. Confirm table names such as oe_hdr, po_hdr and inv_loc in your data dictionary.
  • Approval and workflow features inside P21 that already track who must approve what; reuse them instead of inventing a parallel approval chain.
  • Business rules or alerts that can call a web service or insert a queue row when a hold is applied or a PO is saved.
  • User and role tables in P21 so a Teams identity can be mapped to the correct P21 user and their approval limits.

How it works

  1. 1

    Decide bot versus workflow

    For a handful of alerts, Power Automate with an on-premises data gateway and a P21 SQL connection is enough. For interactive approvals and commands, build a Teams bot using the Bot Framework or the Teams SDK.

  2. 2

    Register the app in Entra ID

    Create the app registration, set the messaging endpoint, and grant only the Graph and Teams permissions needed to post to channels and chats.

  3. 3

    Map identities

    Keep a table mapping Entra user principal names to P21 user IDs and approval limits. A card should only be actionable by the person P21 says may approve.

  4. 4

    Detect events in P21

    Use a business rule or alert to write to a queue, or poll a view for new holds and pending POs every minute or two.

  5. 5

    Render adaptive cards

    Build cards with the key facts and Action.Submit buttons that carry the document key, a nonce and the card version so stale cards cannot be replayed.

  6. 6

    Post decisions back

    On button press, validate the user, call the P21 API to release the hold or approve the PO under a service account, and record the Teams user as an audit note.

  7. 7

    Update the card

    Replace the original card with a resolved state showing who decided and when, so the channel history stays truthful.

Example flows

Credit hold release

Trigger: A sales order is placed on credit hold in P21.

  1. The event reaches the bot service via the queue.
  2. The service reads the customer balance, terms and past due items.
  3. It sends an adaptive card to the credit manager.
  4. The manager taps release, the service re-checks authority and calls the P21 API.

Result: The order is released in minutes and the decision is logged against the order.

PO over threshold approval

Trigger: A buyer saves a purchase order whose total exceeds their limit.

  1. The service finds the next approver from the P21 approval setup.
  2. A card shows vendor, lines, total and budget context.
  3. The approver approves or rejects with a comment.
  4. The result is written to the P21 approval and the buyer is notified in Teams.

Result: Approvals no longer wait on someone opening a P21 window.

Stockout channel alert

Trigger: An A-class item falls under minimum at the Dallas branch.

  1. A scheduled query finds items below minimum with open demand.
  2. The service checks whether an open PO already covers it.
  3. Only uncovered items are posted to the branch buyer channel.

Result: Buyers act on real gaps instead of a flood of noise.

Keeping data on-prem

Teams is a cloud service while P21 may sit in your data center. Keep the bot logic inside your network and let it call out to Microsoft, with the Bot Framework messaging endpoint exposed through a reverse proxy or an Azure relay that forwards to an internal listener. Power Automate reaches SQL Server through the on-premises data gateway, which makes only outbound connections. Anything posted into Teams is stored in Microsoft 365, so keep cards to the minimum facts needed and link to P21 for detail. If you add an AI assistant to answer questions in Teams, run the model on-premises and send only the resulting answer to Teams.

Security checklist

  • Authenticate with Entra ID and re-verify the approver against P21 limits at the moment of action, not only when the card is sent.
  • Use a service account for write-back with narrow rights, and stamp the human approver in a note.
  • Give each card action a single-use token and expiry to block replay and forwarded cards.
  • Limit channel membership for cards that show customer balances or margins.
  • Log all card sends and actions with document keys for audit.

Ways to get it done

Power Automate with data gateway

Effort: Days for alerts, a few weeks for approvals with write-back.

Quick alerts and simple approvals if you already license Power Automate and can query P21 safely.

Custom Teams bot

Effort: Roughly three to six weeks including identity mapping and testing.

Best for interactive commands, rich cards and strict approval logic tied to P21 roles.

Partner such as Netray

Effort: A short pilot, then add approval flows one at a time.

Worth it when you also want a private AI assistant in Teams that answers P21 questions without sending data to a public model.

Pitfalls

  • !Letting anyone in a channel click approve; always validate the clicker against P21 authority.
  • !Posting too many alerts causes people to mute the channel; filter to actionable exceptions.
  • !Duplicating P21 approval rules in the bot creates two sources of truth; read the P21 setup instead.
  • !Exposing the bot endpoint without signature validation lets anyone post fake decisions.
  • !Cards that show stale data after the order changed; re-read before acting.

Frequently asked questions

Can Teams approve Prophet 21 purchase orders directly?

Yes through an integration. A Teams card carries the decision to a service that calls the P21 API or updates the approval record. There is no built-in Teams approval in P21 that I know of, so you build or buy the bridge and map approvers carefully.

Do we need to expose our P21 server to the internet?

No. Keep P21 and the integration service internal. The service makes outbound calls to Microsoft, and only the bot messaging endpoint needs to be reachable, usually through a reverse proxy or relay that does not give access to the P21 database.

Is Power Automate enough?

For notifications and basic approvals it often is. When you need rich commands, role checks against P21 limits, or conversational lookups, a custom bot gives you more control and a better audit trail than a flow alone.

Can the bot answer questions about inventory?

Yes. A read-only tool layer can answer on-hand, allocated and on-order by item and location. For free-form questions, add a model that translates the question into those read-only calls and shows its source.

What about Slack instead of Teams?

The pattern is the same: events out, interactive messages, verified write-back. The differences are in the app model and identity. If your company uses Slack, the same P21 event layer can feed it without redoing the P21 work.

Want Microsoft Teams working on your Epicor Prophet 21?

A free 30 minute assessment: we map the integration path for your version and setup, and where it should run.

Get a free assessment