How to create Sales Order in Business Central using Power Virtual Agent?

Now, when chatbots are becoming a more and more popular way of communicating with customers, all users would like to do more via chatbots. As Microsoft’s response to tools that can make chatbots, there is Power Virtual Agents, and the real power of Power Virtual Agent (PVA) is enormous.

But as business application specialists, we always try to think about how to connect it to some of our Business Applications. This time we plan to connect PVA to Business Central (BC). More precisely, we want to create New Sales Order from PVA and directly in BC.

How we can achieve that, and not to say it is easy, but it is not so complicated. In a concise explanation, we will create PVA with typical questions, and then we will ask some specific questions to our users so that they can give us order-specific data. After collecting data, we will use Power Automate to connect all.

But let’s stop talking hypothetically and start creating our PVA connected to BC.

The critical thing to mention is that I will not explain how to create PVA nor suggest which questions to use to trigger it and which flow you will make. I will focus only on the essential steps you must implement to create a Sales Order in BC using PVA. You can start as you like and do it in the best possible way so that it fulfills all of your requirements.

So, let’s start.

First, you will have to get three essential pieces of information from your PVA users:

  1. Account/Customer No.
  2. Item No.
  3. Quantity of Item which customer wants to buy

You can work with Item Name and Customer Name, but be aware that this can make your process more complicated because we have a few things to take into consideration before using this approach:

  1. Human error
  2. Similar names
  3. Many more questions for users
  4. Many more variables to consider
  5. Etc.

If you want to try this approach, consider this problem, and you can do it. The process is similar, only with some more steps.

But with our approach, let’s create three questions in Power Virtual Agent and define Variables for them:

  1. Choose Add Node
    1. Choose Ask a Question
  2. In Question, define:
    1. What is your company account number with us?
    1. Identify the User’s entire response
    1. Save response as
      1. Click on the Pen icon and name it VarCustomerID
  3. choose Add Node
    1. Choose Ask a Question
  4. In Question, define:
    1. What Product No. are you looking to purchase?
    1. Identify the User’s entire response
    1. Save response as
      1. Click on the Pen icon and name it as VarItemNo
  5. Choose Add Node
    1. Choose Ask a Question
  6. In Question, define:
    1. Can you tell us which Quantity you would like to order?
    1. Identify Number
    1. Save response as
      1. Click on the Pen icon and name it as VarItemNo

And now we have our questions and variables. What we have to do from here is to add a new action in our PVA, but this time is going to be active for triggering Power Automate.

To do this, you will have to:

  1. Navigate to Add node in a Topic editor in Power Virtual Agent
  2. Choose to Call an action
  3. Choose to Create a flow

And from here, you will be redirected to the Power Automate editor, and you should start creating a new Power Automate.

You will see immediately that you already have trigger and Output predefined for PVA. Just keep it, and we will use it in the process.

From here, you will have to create some Variables and, most important Sales Order Header and Line.

As you probably know, in BC, Sales order contains two tables:

  1. Sales Order Header
  2. Sales Order Line

We will have to use both. First, we will create Header, and later we will use the Find Record action to find our Item, and then, in the end, we will fulfill Sales Order Line.

Don’t worry. I will now list all actions one by one and in the order in which you will have to create them so that you’re Power Automate works at the end.

Before you start with Sales Order Header and Lines, as I sed, you will need to do some setup in Trigger and initialize some variables.

For the trigger, what you would need to do is to add you’re Inputs. You will probably understand now whose inputs are values we will get from Questions we have asked users in our PVA.

So let’s create three inputs:

  1. Text: CompanyName
  2. Text: Item
  3. Number: Quantity

And after inputs, I will list all variables you have to Initialize, and all of them will be STRING. Just create them, don’t assign any values. We will do that later in the Power Automate.

  1. Order ID
  2. Currency Code
  3. Item No
  4. Quantity
  5. UOM
  6. Total Price

Now that we have created Variables, we can continue creating records in BC. For better understanding, our Variables are here so that we can collect output at the end and show Sales Order info in PVA so that users can understand what they have created and get some information about orders they had made automatically.

If you want to create Sales Order and not use data back in PVA, you don’t need all these Variables. But when making PVA, it is always lovely to show values at the end to users of PVA.

Now let’s continue with Power Automate, and finally, let’s create a record in BC.

We will now perform three actions; you must do this in this order.

  1. Create Record V3 (Business Central)
    1. Environment Name: SANDBOX (if you are working with a PRODUCTION environment, choose PRODUCTION)
    1. Company Name: CRONUS USA, Inc.
    1. API Category: v2.0
    1. Table name: salesOrders
    1. customerNumber: CompanyName (from trigger)
  2. Find Records V3 (Business Central)
    1. Environment Name: SANDBOX (if you are working with a PRODUCTION environment, choose PRODUCTION)
    1. Company Name: CRONUS USA, Inc.
    1. API Category: v2.0
    1. Table name: items
    1. Filter Query: number eq ‘ItemNo’ (ItemNo Variable form dynamic value)
  3. Create Record V3 (Business Central) (Apply to Each will be created automatically)
    1. Environment Name: SANDBOX (if you are working with a PRODUCTION environment, choose PRODUCTION)
    1. Company Name: CRONUS USA, Inc.
    1. API Category: v2.0
    1. Table name: salesOrderLines
    1. documentId: id (from Create Record (Header) dynamics value)
    1. itemId: id (from Find Records (Item) dynamics value)
    1. quantity: Quantity (from the trigger, dynamics value)

And now, after we have created Sales Order in BC, we need to get data and show them back in PVA so that users can see what they have done.

We will do this by assigning values to our Variables. For this scenario, it is best to use Append to string variable action.

Again let’s see what we have to do here.

  1. Append to a string variable (in Apply to Each)
    1. Name: ItemNo
    1. Value: description (from Create Record line)
  2. Append to a string variable (in Apply to Each)
    1. Name: Quantity
    1. Value: Quantity (from Create Record line)
  3. Append to a string variable (in Apply to Each)
    1. Name: UOM
    1. Value: UniteOfMesureCode (from Create Record Line)
  4. Append to a string variable (in Apply to Each)
    1. Name: Order ID
    1. Value: number (from Create Record Header)
  5. Append to a string variable (in Apply to Each)
    1. Name: Total Price
    1. Value: amountIncludingTax (from Create Record Line)
  6. Append to a string variable (in Apply to Each)
    1. Name: Currency Code
    1. Value: currencyCode (from Create Record Line)

When we have assigned values to Variables, we are only left with a few steps till the end of this scenario.

Now we must create one more Variable and append value to it.

This time we are doing this to format our Output result in the best possible way because formatting output values from Power Automate in the PVA is not the best, so we want now to do it in Power Automate and later show this value in our PVA.

To do this, we will create the following Variable:

  1. Initialize variable (Out of Apply to Each)
    1. Name: Order
    1. Type: String
    1. Value: (none)
  2. Append variable
    1. Name: Order
    1. Value:
      You have created a sales Order with ID: Order ID (Variable dynamics value)

With Item: ItemNo (Variable dynamics value)

Quantity:  Quantity (Variable dynamics value) UOM (Variable dynamics value)

With total price: Total Price (Variable dynamics value) Currency Code (Variable dynamics value)

And now, we are just two more steps to the end in Power Automate.

This time we must use two actions and keep in mind that one of them is already there, so in reality, we must create one more cation (COMPOSE) and, in the end, assign that value to our PVA output.

  1. Compose
    1. Inputs: Order (Variable dynamics value)
  2. Return value(s) to Power Virtual Agents
    1. Inputs
      1. Text: Item
        1. Outputs

And now we are finished with Power Automate. All that is left here is to Save it, jump back to PVA, and map Variables in PVA so that our inputs in Power Automate can work. Your Power Automate would look like the one on the Screenshot if you created it with the exact steps I described.

To do this, you will have to go back to your PVA and inaction, which you have called Power Automate. You have to choose one which we have created just now.

  1. Choose Power Automate, Which you have created
  2. Setup Variables
    1. CompanyName (text) -> VarCustomerId
    1. Item -> VarItemNo
    1. Quantity -> VarQuantity
  3. Add Node
    1. Show a message
      1. Dear customer VarCustomerID (add a variable from the list),

Your order has been created with the following details:

Item (variable from the list)

Now you can Save your PVA and Test it to see if it works. If everything is fine, the result will look something like this.

This is not the end. You can continue playing with this PVA and add one new branch where you will create one more Power Automate for users who are not Customers in BC and first create them so that they can make an order. But this is the end for this scenario, How to create a Sales Order from PVA in BC.

In conclusion, when we can use Power Automate with some other tool natively, SKY IS THE LIMIT in what we can do.

I know that this scenario has a bigger number of steps, but in total, it is not so complicated. Still, it gives an excellent perspective on what you can do and gives you an idea of what some other Power Automates should look like if you are using them from PVA. Enjoy creating this Power automate and Power Virtual Agent.

Dynamics 365 & PowerPlatform Conferences in 2023

We are close to the end of this, and we mostly have important conference dates for the following year. I would like to have all Dynamics 365 (and/or Power Platform) conferences in one place, with all dates planned for 2023. So, you can find them here and start planning your attendance as most of them have early bird:

  • Days of Knowledge US (September 2023 – TBD)

I hope I’ll se you on some of them.

Where is the limit in Business Central CRM capability when integrating it with D365 Sales? (part 2)

So, after introduction to this topic, it is time to continue with it and say when you would need to consider extending your Business Central with a license for Sales Professional.

First, what I would like to introduce you to is a small dictionary. The reason is that we have a few of the same, but they have different names. The reason is that Business Central is a financial-focused system, and all data you see in it are focused on your financial transactions with your clients. On the other side, Sales Professional is a Customer-Centric system, and all data in it is focused so that you can have a better view of your clients and make better relationships with them.

Business CentralSales Professional
ContactsContacts (only person)
CustomerAccount
VendorAccount
ItemsProducts
Unit of MeasureUnit Group

After the dictionary, you probably already have a perspective of the focus of each system, as I have previously mentioned.

But why should we stay on a dictionary when we can split all of the things and dive deep into the actual capabilities of a Sales Professional? You will have a better perspective after seeing what is different and when it would be nice to consider extending your Business Central with a Sales Professional license.

Contacts

So, first of all, if we focus on a Contact table, we will see that Contact can be both Company and Person in Business Central, but in the Sales Professional, Contact is only based on a Person.

But besides this difference key difference is the data that we see in both solutions. Sales Professionals have all data which is essential for a salesperson, for example, all recent Opportunities, general information about clients (Name, Email, Preferred Method of Contact, Address, Marital Status, Contact Preferences, Marketing Information of origin of Contact… etc.) and Timeline which I will explain in a separate section because it is on of the main features which are focused to the Sales Professional users.

We have some of the same information on the Business Central side, but all focus on different users. All data in Business Central is focused on a client’s financial data. Still, of course, it is not only financial stuff, there is some of the information that a Sales Professional has, but the whole UI is different and makes users first see relevant data for one ERP system.

Accounts

If we look at the Accounts (Customers/Vendors) situation, it’s like the Contacts. But the main difference is in the gettering Customer and Vendors to the one record, which is the crucial difference from where we can understand the different focus of these two solutions. As previously mentioned, several times, besides UI focus difference whole solution is for another type of user, and each of the solutions makes you look to the specific data which is most important for key users of each of them.

To better understand the difference, you can see that Sales Professional focuses on the Annual Revenue of the whole company, how many employees the company has, what is the company’s industry of the company… etc. Regarding all of this data, you can see that a Sales Professional focuses on adjusting your sales team to make even better sales to this client.

Lead

Lead does not exist in the Business Central, and Lead is our introduction to the Business Process Flow.

Let’s first start with the actual usage of the Leads, specially Leads for Business Central users. Lead is the first contact with some Account or Contact. This means that the salesperson has just talked with somebody, but they are still unsure if they can make actual sales, so we are creating Leads for the starting status. One of the most important things with leads is that they can be used with existing clients and those you don’t have in the system. Suppose contact has been made with someone you don’t have in the system. In that case, another does not create a Contact or Account until you qualify them for the next stage of negotiations, not synchronized as a Contact/Vendor/Account. You will not have several useless clients from whom you have never sold or bought anything in your Business Central. But for the salespersons, this is most important because they will start to negotiate and negotiate sales from here. While salespersons are trying to make as many sales as possible, there is a graphical process that takes them through precisely defined steps to focus on essential communication with potential clients. This graphical leading is called Business Process Flow.

All salespersons can Qualify or Disqualify a Lead. Qualification takes us to the Opportunity, where Contact and Account will be created if they don’t exist in the system already. And important is that Business Process Flow will continue regardless we are getting on to a different table.

Opportunity

From Opportunity, we are returning to the familiar thing we have in Business Central. Still, from the side of a Sales Professional, it depends on how far we will go with the Opportunity. Would we go to the moment to create a Quote inside Sales Professional, or will we leave all financially focused data to the Business Central?

Sales Professional is fully capable of giving a quote, order, and invoice, but as recommended, we should provide a quote from Sales Professional or leave only on the Opportunity level and go to the Business Central and make a Quote from here.

This is all up to you and your use case. It is important to know that all Items and Units of Measure are synced between both systems. All data is available on both sides, and you will receive it back to Sales Professional if you create Quotes in the Business Central. From the perspective of Business Process Flow, it is always there until you finish with this Opportunity and close it as Won or Lost.

Timeline

Timeline is one of the greatest strengths of Sales applications because you have it on all tables and can see all communication with a client. It doesn’t matter if it is regarding just Account or Contact communication or sales regarding the Opportunity or Lead. You can write it manually or make a Phone Call or Email Appointment. Still, more important, if you connect your Outlook with Sales, what can be created in just a setup connection, you can automatically generate all communication with clients and be informed about every and each communication that happens with a specific client.

And with the new release, you have Teams integration based on the table, which means that you can start the conversation which stays connected to the record, and everyone can see it and be informed of what you have to say about the Client or Sales Opportunity.

Conclusion of part 2.

We have passed key differences in some of the tables most used in collaborations for both systems. In the next blog post, I will explain to you how it is possible to make Data Synchronization and make basic integration of them both so that users can get full capabilities of both solutions and get the correct data in the right solution so that users of both solutions can have the best possible information’s which are related to them and that each company which has both of the solutions can make even usage of them both.

Dynamics 365 Sales Professional Infographic

Recently I finished my session about using Dynamics 365 Sales professional with Business Central at Directions EMEA. But there were many questions about D365 Sales Professional capabilities… what is possible, where are limitations…

First, Sales Professional is a CRM solution for SMB companies targeting businesses with more straightforward sales needs with basic sales force automation and limited customizations. But it is still a powerful tool, and I wanted to show you what this app includes using an infographic model. You can see details here:

What more is essential to know? You cannot mix a Sales Professional license with Sales Enterprise (and other Sales licenses)… if you decide to use Sales Professional, you must use it for all Sales users. But if this is not enough for you (at some moment, your company has grown), you can upgrade this license to Dynamics 365 Sales Enterprise.

If you like this infographic, I’ll add a similar one for Sales Enterprise.

Business Central Free of Charge

Directions EMEA has just been finished, and there was a lot of good news. One is access to the Business Central environment with the Microsoft 365 license. Now statement ‘free of charge” is partially correct.

What does it mean? You cannot get the Business Central environment free of charge as you must buy a minimum of one full user to get access (the whole article is about the cloud option). But when you have access to the environment, you can get free-of-charge access for all your users with Microsoft 365 license. This is huge news. As far as I know, there is no business solution (minimum, no global solution) to which you have free access. Of course, Microsoft will not cannibalize itself, and this access has some limitations, but this is a fantastic thing and can dramatically increase this solution’s use in the future.

You can find details in the following table about what you can use in Business Central with which license type. I hope it is helpful.

Reminder about D365 Sales Professional

As I started to write about Dynamics 365 Business Central with Sales Professional series, you will probably need a few directions on how to test it and about limitations (when to accept them or to go to the Sales Enterprise). As I already wrote about it two years ago, I just wanted to remind you as this is something you will need if you want to track what I’m writing or more about my session in Directions EMEA.

There are two posts you should read if you are interesting for this topic:

See you in the following blog posts or in Hamburg.

Dynamics 365 SMB Ecosystem Map – October 2022

You already know Microsoft publishes new releases two times per year (wave 1 in April and wave 2 in October). You can find all news in Microsoft’s release plans. There is also an amazing ecosystem map by Vadim Korepin about all solutions in Dynamics 365 family.

But as I’m most connected with SMB solutions inside Dynamics 365 and Power Platform, I wanted to share more details on what is available for SMB users and companies from Microsoft Dynamics 365 family. Three business applications (Dynamics 365 Business Central, Sales Professional, Customer Service Professional) covered ERP and CRM parts but with plenty of features. I’m sure no other vendor currently can offer more for SMB customers worldwide.

You can look at and download the Ecosystem map for Dynamics 365 SMB solutions I created (resolution is 3840×2160):

I hope this SMB ecosystem map will be helpful for you, and we will have more features and maybe even more solutions here in the future.

Business Central and D365 Sales

I know it has passed since I wrote the first part of this topic, ‘Where is a limit in Business Central CRM capability and when integrating it with D365 Sales (part 1),’ and people expect the second part. But as I’ll speak about this topic on Directions EMEA this year, I decided to postpone the following parts after this event. I would like to keep it interesting and show many of these topics in my session. Of course, as I cannot go so deep into details in 45 minutes, I’ll continue here with publishing my point of view related to this topic.

In the meantime, if you will attend Directions EMEA in Hamburg this year, I warmly invite you to come to my session and discuss this. My session will hold on November 10, 2022, from 11:15 to 12:00 in Room: Hall Y4 – Dynamics 365 Sales Professional for Business Central Users.

But I promise I’ll continue with this topic here in my blog.

Where is the limit in Business Central CRM capability and when integrating it with D365 Sales? (part 1)

We know that Microsoft Dynamics 365 Business Central (previously NAV) is primarily an ERP solution. But even so, this product has some customer relationship management capabilities. And name ‘Business Central’ probably comes because this solution can provide all business activities in one solution. But as this is primarily an ERP solution, the biggest strength comes in ERP, and in other areas, such as CRM or HRM, the level of functionalities is significantly lower. But let us make an overview of what is already in Business Central, but we can say it can be treated as CRM.

First, what we can find are a good customer and contact management. Still, as customers play an essential role in every ERP solution, we can emphasize more about contact management where we have some basic information about contacts and some segmentation.

You can also find some level of creating and tracking opportunities and sales quotes and interactions. You can also have some possibilities to make direct phone calls from BC or send an email. This is more or less what we have, but this is not a small number of functionalities.

Today I’ll not go into details about all these features. I just wanted to show some basic information about them and explain on a high level in which situation you should think about an additional and full CRM solution. As a full and independent CRM solution, I’ll focus on Dynamics 365 Sales Professional:

  • First, naturally, if you don’t have enough functionalities, you will take a specialized CRM solution, but let’s talk in detail on another occasion.
  • Second, the price can be an issue. If you have pure CRM users, they still need to pay $70 or even $100 for the license as they must pay a BC license even if they need only CRM capabilities. Sales Professional full license price is $65, and you can get full CRM. But with the new attach license for Dynamics 365 Sales Professional, BC clients can add a full CRM solution for an additional only $20.
  • Third, as I mentioned in the beginning, Business Central is still primarily an ERP solution, meaning its UI is built for ERP and not for CRM. Even if you have many CRM features, when we compare usage of these features, this is definitely not even close to being useable as in a regular CRM solution.
Dynamics 365 Sales Lead to Opportunity Business Proces Flow

Today I wanted just to make a high-level overview, but in future texts, I’ll try to be more accurate about when CRM in Business Central is enough for you and when you should think about integration with Dynamics 365 Sales.

I’m logging out

I haven’t written s single blog post for some time and I definitely decided it will be my the last one. I’ve been writing on this blog for 8 years, but I started with another domain even a couple years earlier. In this period I’ve got some really valuable feedbacks with the huge impact on me and I want to thank all of you who read these articles or eventually post some comment/question.

I’ve made this decision as I joined Business Central product group as a Program Manager and when I have something to announce or say, it will be done through Microsoft official channels. I don’t want to bring anyone into an awkward situation by misinterpreting in some situations. Of course I’ll continue to use LinkedIn and Twitter for communication, but I’ll not continue with blogging.

But just to know, this blog will stay active minimum from two reasons:

  1. There are still a lot of valuable information not related with specific version
  2. And my son will continue to use this blog (he has already proved in a Dynamics business)

That means when you find new articles in the future, they will be written by my son Marko Totovic. I think it will be even more interesting in the future as he will bring some new topics and applications from Dynamics & Power Platform family. And just to know some of existing articles already has been written by him.

I think you we hear from me soon but using different types of communication. Meanwhile, give the opportunity to my son to show what he has to give you. totovic.com will continue in a new suit.