Implementing a Multi-Step Process for AI Recommendations in Business Central
This post demonstrates how to build a multi-step AI-assisted process in Business Central that generates product recommendations from sales order line descriptions. The process uses AI to identify keywords from sales line data, then searches the item catalog to recommend relevant products for users to add to their orders.

post Aardvark Labs
"The AI Agent doesn't have to provide the entire answer. In this case it digested data that we could use in our process."
Key points
- AI can play a supporting role in a multi-step process rather than providing complete answers
- The implementation collects sales line descriptions and passes them to an AI agent to extract keywords
- Keywords are used with Full Text Search (release 25.2) to find matching items in the catalog
- Users can select recommended items which are then automatically added as new sales lines
- Tracking token count by character length helps manage AI costs and improves result quality
Quotes
- “The AI Agent doesn’t have to provide the entire answer. In this case it digested data that we could use in our process.” (This insight explains that AI should be designed as part of a workflow, not as a standalone solution, enabling better integration with existing business processes.)
- “On line 18 we use the Full Text Search functions of Business Central that were introduced in release 25.2.” (Highlights the use of Business Central’s native Full Text Search capability to find items matching AI-generated keywords, avoiding the need to share entire catalogs with third parties.)
- “Because these are going into the user prompt, and ever 4-ish characters is a token and tokens cost money.” (Demonstrates practical cost optimization by limiting description input to 10,000 characters, showing awareness of AI token economics in production implementations.)
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.
- table “ARD_CopilotItemRecommendations”
- page “ARD_ItemRecomendations”
- codeunit “ARD_CopilotItemRecommendations”
- page “ARD_ItemRecommendationPrompt”
- table 37 “Sales Line”
Not found in BC28-30: table “ARD_CopilotItemRecommendations”, page “ARD_ItemRecomendations”, codeunit “ARD_CopilotItemRecommendations”, page “ARD_ItemRecommendationPrompt”.
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- BC Friday Tips #56 Understand Missing Fields in Copy Documents — possibly related: both name Table 37 “Sales Line”
- BC Friday Tips #84 Why Is Your Item Missing from the Sales Line Lookup? — possibly related: both name Table 37 “Sales Line”
- Business Central Development Serie - Part 2b: AI for BC Development — The Knowledge Gap That Ships to Production — possibly related: both name Table 37 “Sales Line”
- Dynamics 365 Business Central: Add a Scan Barcode action and scan multiple/Continious scanning (Invoke barcode scanning programmatically from AL) — possibly related: both name Table 37 “Sales Line”
- Dynamics 365 Business Central: Entering Quantities/Amounts by Calculation and Negative Numbers — possibly related: both name Table 37 “Sales Line”
- Dynamics 365 Business Central: How to flow/pass custom field values from Sales Order to Production Order — possibly related: both name Table 37 “Sales Line”
- Dynamics 365 Business Central: How to note the records that the user has selected on the Subpage/Lines (Page.SetSelectionFilter in part) — possibly related: both name Table 37 “Sales Line”
- Dynamics 365 Business Central: How to quickly check if a field is a primary key field — possibly related: both name Table 37 “Sales Line”
- Dynamics 365 Business Central: Quickly get next Sequence/Entry Number (without using FindLast -> Entry No. + 1) — possibly related: both name Table 37 “Sales Line”
- Dynamics 365 Business Central: Use a default quantity of 1 for all types on documents – Customization — possibly related: both name Table 37 “Sales Line”
Context
- Features: AI-powered item recommendations, Full Text Search, JSON processing, Sales order line analysis, Temporary table management, Multi-step process design, Keyword extraction, Item selection and insertion
- Versions: 25.2
Source: Aardvark Labs, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.