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.

Advertisement

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.

BizApps Wiki – a great place for ERP, CRM and other experts

New platform BizApps.Wiki has just started. On the first sight it looks like as well know Wikipedia, but there is ‘but’…

In comparison with Wikipedia there is highly focused content only with business applications (solutions/software) and other related topics. By the business application topics you can find information about almost all possible business application solutions as well as vendors (global and local). Also you can find information about partners or about the most impactful experts (MVPs or similar).

By the ‘other related topics’ it means you can find a lot information about project management, business processes, implementation processes, learning guides, certifications, events, communities, accounting… and so on.

OK it is obviously that topics are not related only with Dynamics solutions as this is Wiki about all business solutions, but there are for sure a few dozens of articles (maybe even more) related only with Microsoft solutions.

And on the end, there is one really good idea about building the digital business applications museum. Even if its history is not so big, it is very interesting how these applications looked like 20-30 years ago. And this is not finished project… as you can see on the first page, this is an ongoing project (always work-in-progress) where it is expected that community will take a part in building or editing this library of articles.

I’ll not write about the project in more details as you can easily go there and check. Definitely good for developers, consultants, project managers, but also for future experts such as students…

Business Central & Power Platform Exams Experiences

Recently I’ve passed these two new exams: Business Central Functional Consultant Associate and Power Platform App Maker Associate and I would like to share some my experience about them. I’ll try to be brief and just to give you some basic directions.

First I need to admit that I’m not big fan of this kind of certification. Based on my previous experience 10+ year ago, it was more about getting certificate and less about proving a real knowledge. I had an opportunity to meet a lot highly certified persons, but they couldn’t implement even the easiest projects. But still, partners wanted to invest in certification as some kind of knowledge proof.

But with new exams in the last few years things are slightly changed and I had opportunity to check them. But with these two new exams I’m talking about, things improved drastically. And I can say I’m really positive surprised.

First what I want to say is that I didn’t prepare myself for these two exams. And when I say ‘I didn’t prepare’, I mean it for real. I wanted to see if it is possible to pass these exams with real experience and practical knowledge. And I succeed! From my perspective this is the most important fact – if you are waring with these technologies and have a real practical knowledge, you can pass them without any problem. It still means you should be focused on questions as they can sometimes be complicated, especially when it comes to the case studies. I didn’t want to say these exams are easy as they are not, but you don’t need to prepare yourself if you know topics. But to be honest, you can still find a couple of useless questions, you really don’t need in practice, but even if you fail on some of them you will still have big chance to pass exams.

What I want to mention about BC exam is to be prepared with SaaS topics as this is very important. It is not enough to know only features in system, as you need to understand cloud concept as well. On the other side, when we talk about Power Platform, you should know both Canvas and Model-driven Power Apps, Power Automate as well as other Power Platform features (AI, Chat Bots…) and CDS. But this is what we imply with the Power Platform knowledge.

If you are newbie, in this case you need to learn for these exams. But good thing is that if you want to start, you can find everything you will need on the Learning Path site. But one small note, when you start to learn from Learning Paths, I often hear that there are not enough information and some of people often fail on exams. This is because, you need to open every link you have in your learning path as often you can find basic information in this part of text, but when you click on some links, you will be redirected to Microsoft docs site with all necessary information with related topic.

On the end I want to say THANKS to all people involved in preparation these two new exams as they made a good result. And for all of you who didn’t register for these exams, do it… you will not make mistake.

Some blog statistic and feedbacks

It is the first day in 2021 and I just want to put some numbers on the paper. If you don’t agree with my conclusions, please send me some feedback and I will appreciate it.

Looking back I analyzed some numbers in my blog and found interesting that the most read articles were not related with technical topics and I was surprised with this. Because of that I want to share what topics was the most interesting for you in the past year.

If you didn’t find these topics, you can do it here:

Dynamics 365 Ecosystem Map

Business Central Functional Areas

Business Central OnPrem vs Azure vs SaaS

Looking in feedbacks, I can also recognize that these three topics were between the most popular. Ok, there is still 72% other reads, but there are consisting from hundreds of other topics. That means you still want to read technical topics, but you are interested in some other as well.

To be honest I was surprised in one moment that many of readers didn’t know that i.e. BC has some of features before my map of functional areas. An for sure, I’ll do more in this direction to make all of this areas more closely to all of you.

I’ve got some other statistics as well, but this is something I’ll use for my internal research. I just want to say thanks to all of you who read my posts and especially to ones who sent some feedback as this is extremely important for me. All the best in 2021!

Dynamics Events in 2021

We are at the end of this year. I could hardly say – good year as we have global pandemic and people dye. But new year is coming and there are some lights at the end of tunnel; vaccine appears and probably we will have better year as I think it is not possible to have worse one.

Let’s see what events await us in 2021. I (and probably nobody) don’t know if these events will go virtually as this year or on site if this is possible, but let’s see what we will have.

In the first half of year, we will start with Directions events:

This is what we have on the list for the first part of year, but we have two more events already scheduled for the second half of 2021:

Of course we have more, but still not scheduled. What you can do now is to sign up and join mailing lists to be updated when they announce dates. Currently, I can suggest to do it for the following events:

Dynamics 365 Community Summits (Australia, Europe, US)

Microsoft Business Application Summit

On the end, I really hope we will win Corona virus and we will have minimum few events in live as conference is not only about content and it is about networking and building friendships. We as human beans still need live communications. Maybe we proved that a lot of things can be done in virtual environment, but some thing can be done only in real world.

I hope we will have healthier and more successful new year and I’ll meet some of you in person.

Directions EMEA 2020 – Day 1

Directions EMEA and Asia has just started today. This is the first-time virtual Directions ever and I can just imagine how challenged it was to prepare everything in very short time. But based on what I saw today, everything is well organized. OK, this is not the same as live event and I would like to have an opportunity to meet all of you in person, but it is still the great option with not only sessions but with a lot of networking opportunities. And just to mention, this is the biggest Directions ever with 2775+ attendees. Great achievement!

Today we had the first day Keynote and after that I had my first session. Now I want to share my experience from these two parts of today’s event.

Christian Sega started with good news about numbers (2775+ attendees, 60+ countries, 147 sessions, 101 speaker…) and future of this event and finally we had an opportunity to see Mike Morton as a new GM on the Directions stage… unfortunately not in live, but again this is the first time on Directions stage.

Mike presented roughly the most important directions from this BC release and they are:

  • Deliver seamless service and performance
  • Design for compliance and security
  • Develop ISVs and globalization
  • Delight customers by exceeding expectations
  • Drive better together Microsoft experiences

Let’s talk about these directions in the next days. Now I want to talk more about numbers. First time we had an opportunity to see official numbers about BC SaaS customers – there are 10.000 BC online customers and by my opinion this is an amazing result. And only this, there are other impressive results…

I don’t want to forget great rest of the keynote with Claus, Jannik and other PM’s where they showed some new and really good features.

And finally, Mike announced roadmap and some new features ready for the next release. First let’s make a look at new roadmap:

Now make a look at some of the next release’s features:

  • Finally, we will get Report Extensibility as this is one of the highest voted idea from users and partners… this is something we are really missing.
  • We will get enhancement printing features in BC, improving complex hybrid setup, taking care about user access to printers, eliminating admin of print servers or printer drivers, printing from anywhere…
  • Easily onboard of new clients to BC using step-by-step guide how to configure and prepare your solution, and it will be possible to use for partner’s addons as well.
  • Better integration of BC with Teams as using BC directly from Teams.

What I wanted to emphasize… completely experience with the Directions4Partners platform was/is great (if I forget some minor technical issues… who knows, maybe only at my place😊 because of my connection). You could have a feeling you are really on a site. This is briefly my experience from my first session. After 30 minutes prerecorded session, we had additional 15 minutes for live Q&A. I have a lot of questions and I had an opportunity to have a live answering session and it was good experience. As we probably had more question, we needed to continue our chat somewhere. For this purpose, we could go out to the Q&A session room and continue with discussions about all specific topics. Really great experience. I had an opportunity to meet some of friends and big thanks to Arend JK who attended my session and who continue chat with me and few other attendees in the Q&A session room. He also helped me answering on some questions. Big thanks for you Arend as well as to Christian Sega who joined us in after session time.

I’m looking forward to see more sessions today and next two days and I really hope it will be great experience.

Dynamics 365 Ecosystem Map October 2020

Recently I published a blog post about Dynamics 365 Ecosystem for April 2020 release. As I see many of you downloaded these images, but I also got a comments that this was outdated as a few days ago Microsoft announced October 2020 release (2020 Wave 2 release). Because of that I started with updating these graphics and I’ve just finished with all news.

Again, I want to mention and to say ‘thanks’ to Vadim Korepin who made this initial graphics. I used his initial slides and added all news from the last release. But even more, I found that one important part of Dynamics 365 ecosystem was not there – Industry Accelerators. They are very important parts of ecosystem and it can be very useful for some specific industries. This time I added them, and I hope we will have more and more partners using them.

If you want to collect images in the best resolution, download them (right click on the image) and you will get 3840×2180 images.

And let’s start with the first image where we have completely list of all Dynamics 365 solutions and other related solutions:

Then we can continue wit ERP ecosystem where we have some added features in each of them:

The same situation is with CRM ecosystem where we got some new features:

With modular solutions we have some differences as now we have Dynamics 365 Customer Voice as new solution:

Dynamics 365 AI solutions have some new features as well as Mixed Reality solutions:

List of Dynamics 365 services is extended for new service – Electronic invoicing Add-on:

And now new part – Industry Accelerators for specific vertical solutions. This is completely new page with accelerators details. Based on official documents, industry accelerators are foundational components within Microsoft Power Platform and Dynamics 365 that enable ISVs and other solution providers to quickly build industry vertical solutions. The accelerators extend Common Data Model to include new entities to support a data schema for concepts within specific industries.

And finally, platform again with some updates:

I hope you will use these images in daily business and especially when you need to explain connections between our ecosystem.

Dynamics 365 Ecosystem Map April 2020

Last months I see a lot of interests for completely Dynamics 365 ecosystem map. Even if we now what is part of Dynamics 365 ecosystem, visualization is much better. Because of that I want to share with you one global ecosystem map and more detailed maps per each solution. This is the last one made for April 2020 release and thanks to Vadim Korepin who made it. Keep in mind that resolution in my blog is not the best, but if you want to get in the best resolution, download image (right click on the image) and you will get 3242×1843 picture.

First start with completely Dynamics 365 ecosystem with all solutions.

Now let’s continue with more details. First let’s make a look in ERP ecosystem (Finance, SCM, project Operations and Business Central):

Logically we will continue with CRM portfolio:

Now to add ecosystem of our modular solutions to complete ERP and CRM solutions:

AI Solutions in D365 ecosystem looks like that (keep in mind that we have some additional embedded AI features in other solutions):

Mixed Reality is also part of Dynamics 365 ecosystem:

This is the list of Dynamics 365 services:

And the last but not the least, Microsoft platform ecosystem (Power Platform and other Microsoft platforms):

When you look at all these maps, it is obviously that we have a great ecosystem in Dynamics 365 family. I hope you will use these charts in daily business.

Business Central Functional Areas

Usually when I talk with people with a small (or without) experience in NAV or Business Central but with ERP knowledge, they don’t know what functional areas are covered with Business Central. Mostly, they find something on internet that it is for SMB and they assume it cannot be used for complex business processes. Yes, Business Central is on the first place for SMB, but it can be found in very complex business as well and it covers the big number of business processes. And yes, Business Central is full ERP system.

Because of that, I wanted to show simplified map what business process are covered with standard Business Central. But just to clarify, this map represents only an overview of business processes… and if you want to see all of them, I can suggest to discuss with someone who is experienced and who can show everything what is possible.

As this picture cannot be viewed good here on blog post (small resolution), I’m suggesting to download it and to open as a picture on your desktop.

And what is important on the end… Business Central is easily extended solution. You can extend it adding new functional areas from AppSource or developing them from your partners.