community postCopilot & Agentscommunity - not Microsoftreviewed - checked by Opus

Step-by-Step Guide to AI Campaigns in Business Central

A practical guide to building AI-powered marketing campaigns in Business Central using two coordinated AI agents. The system generates regional postal codes based on natural language prompts and automatically adds free samples to sales orders shipping to targeted regions, minimizing AI costs by preprocessing data rather than running AI logic on every transaction.

post Aardvark Labs

Marcel Chabot · 2026-01-23 · 1,229 words · about 6 min

"The core to any AI system is prompt management. In this case we have to manage the interaction between two prompts."

Key points

  • Uses two sequential AI agents: one for grounded search to find postal codes from natural language scenarios, another to extract postal codes into JSON format
  • Leverages Business Central’s managed AI resource with Bing Grounded Search for accessing current event data that public OpenAI cannot reach
  • Saves AI costs and improves performance by running AI only during campaign creation, then using native AL code for order processing
  • Implements campaign logic via OnBeforeReleaseSalesDoc event to check shipping addresses against stored postal codes and add promotional items

Quotes

  • “The core to any AI system is prompt management. In this case we have to manage the interaction between two prompts.” (Emphasizes that coordinating multiple AI agents requires careful prompt tuning for each to work effectively together)
  • “This system trades a tiny bit of BC storage for a huge AI savings and performance handling.” (Explains the tradeoff strategy that makes the solution practical and cost-effective for high-volume operations)

AL objects mentioned

As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.

  • page “AI Campaign (custom)”

Not found in BC28-30: page “AI Campaign (custom)”.

Context

  • Features: AI agents for regional data lookup, Managed AI resource with Bing Grounded Search, Copilot prompting system, JSON data extraction from AI responses, OnBeforeReleaseSalesDoc event handling, Natural language campaign generation

Source: Aardvark Labs, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.