TL;DR
A custom agent in Microsoft Dynamics 365 Business Central can automatically review customer ship-to addresses and assign the correct fulfillment location. This simple setup improves efficiency, reduces manual work, and provides full visibility through task logs for easy troubleshooting and optimization.
Shipping Location Alignment Custom Agent in BC
I want to show you how you can create a simple agent in Microsoft Dynamics 365 Business Central. Business Central now has the ability to create custom agents, and I created a simple one to walk you through. We’re going to take a look at a custom agent that I built. It’s straightforward and focuses on acting on master file data. After we run it, we’ll review the results, and on the agent card there’s the ability to drill down into a task log so you can see exactly what the agent did.
Understanding the Use Case
Here’s the use case. For all customers that have a shipping address, I want to make sure that each shipping address is fulfilled from the correct location within my company. I have three fulfillment locations, and I want to make the most efficient use of those locations based on the ship-to addresses of my customers.
Why This Matters
Assigning the correct fulfillment location ensures operational efficiency, reduces shipping delays, and optimizes resource utilization. Instead of manually reviewing each customer record, the agent automates the process based on predefined logic.
Setting Up the Environment
I’m working in a sandbox environment, which I highly recommend when testing something like this. In this environment, I already have several agents set up. Some are standard agents from Microsoft, and one is a custom agent that I created.
Creating and Reviewing the Custom Agent
When I open the custom agent, you can see that it’s currently active. There’s a description in place, along with basic profile and permission settings. The key part is the instructions. They’re simple: I have three shipping locations in my company—main, east, and west. I want the agent to review all customers, look at their ship-to addresses, and assign the correct fulfillment location based on predefined rules, such as state.
Reviewing Customer Data Before Execution
If we look at a customer record, we can navigate to the ship-to addresses. You’ll notice that initially, there is no location specified. If we remove filters and view all customer ship-to addresses, we can see that none of them have assigned locations.
What the Agent Will Do
This is exactly what the agent is designed to fix. It will evaluate all ship-to addresses and assign the appropriate fulfillment location automatically.
Running the Agent Task
Back on the agent screen, we can run the task. The instructions are already set, so there’s no need to make changes. I’ll run the task using a saved template and proceed without adding any extra input.
Task Execution
Once started, you can see the task running, and after a moment, it completes.
Reviewing Task Logs and Details
Now we can review the results. Opening the task steps shows that the agent evaluated all relevant customers and made updates to their ship-to addresses. By refreshing the page, we can see a full list of actions taken.
Drill Down for Insights
You can also drill down into specific entries to view detailed information. This is especially useful because it shows exactly what the agent did, and if there are any issues, you can identify errors during processing. This level of visibility makes troubleshooting much easier.
Iterating and Improving the Agent
It’s important to understand that working with agents is an iterative process. You create an agent, run it against your Business Central data, review the results, and refine your approach.
Best Practice: Use a Sandbox
Using a sandbox environment helps you experiment safely and learn how the agent behaves before deploying it more broadly.
Reviewing Final Results
Finally, let’s look at the results in the customer records. When we go back to the ship-to addresses, we can now see that locations have been populated based on the instructions given to the agent.
System-Wide Impact
Viewing all customer ship-to addresses confirms that the agent successfully aligned each one with the appropriate fulfillment location across the system.
Final Thoughts
In this walkthrough, we created a custom agent in Microsoft Dynamics 365 Business Central that works with master data and makes updates based on predefined logic. We explored the agent card, reviewed task logs, and examined detailed execution steps.
This example is a simple but effective way to understand how agents function in Business Central. Compared to more complex transaction-based agents, this approach is straightforward and a great starting point if you want to learn how to build and use custom agents.
If you’re ready to deploy Copilot in Microsoft 365, download our free guide using the link in the video description.
Related Demos
Try Dynamics 365 Business Central Today
![]()
Chat with a Customer Service Rep.
Available Monday-Friday
9 AM to 6 PM Pacific Time.
USE THE CHAT BOX >





