Dynamics 365 Business Central Virtual Table with Dataverse (Custom Table)

In continuation to the previous post, where we have discussed how we can configure the Dynamics 365 Business Central Virtual table with Microsoft Dataverse from scratch, in this post, we will be walking through how we can extend and configure them for custom tables.

Prerequisite

  1. Visual Studio Code.
  2. Dynamics 365 Business Central Sandbox Environment.

VISUAL STUDIO CODE

Visual Studio Code is the primary code editor for the Dynamics 365 Business Central development. It allows us to write and debug the code in the AL language in which the extensions are written.

Installation

To install Visual Studio Code go to the page and download the current version for your platform.
After installation open Visual Studio Code and go to Extensions management and find the AL Language and Install it.

As you can see In my case It is already installed, It will take a few seconds to install.

ONLINE SANDBOX ENVIRONMENT

Below is my Dynamics 365 Business Central Sandbox Environment which we will use in this post.

First Step we need to create an AL project in visual studio code and connect to business central.

AL Project

To create a new project for Business Central open Visual Studio Code and then open Command Pallete. The key shortcut for that is Ctrl+Shift+P.

Then write al go You can also use the key shortcut Alt+A, Alt+L.

After specifying where the project should be stored, you will need to choose for which platform you are doing development. We will select the latest available platform.

The next step is to decide if your development environment will be an online sandbox or your own Docker container. If you would choose the online sandbox you will be prompt to log in to it.

In our scenario, we will select Microsoft Cloud Sandbox.

Our first application will create after this and it will contain bellow three files.

  1. launch.json -This file describes where the development environment is placed.
  2. app.jason – This file provides the most important information about the extension which you develop. You can find a name and a description of your extension, information about a publisher etc.
  3. HelloWorld.al -This file is your first code. It simply shows the message when you open the customers list.

As a next step before connecting to the Bussiness Central sandbox environment, we have to download symbols.

Download Symbols

when you created a new project and open HelloWorld.al file, you have errors. One of them says
that the target page “Customer List” for the extension is not found. The reason you do not have symbols downloaded.

To download them you need to open Command Pallet (Ctrl+Shift+P) and run function AL: Download Symbols, Symbols can be found in the folder .alpackages.

If you are using Online Sandbox and running the function the first time, then you need to log in to your environment.

After the symbols will be downloaded, you should be able to see the app files in the .alpackages folder.

As a next step, you need to connect visual studio with your sandbox environment for this we need to write the below code in the launch.json file.

Once connected successfully, we will create New Table(s) and Page(s) in Business Central.

Below is the AL code for Car Brand Table, and Page that will be created in Business Central via Extension, used for Integration with Dataverse.

Car Brand Table

Car Brand Page

Car Brand Card Page

Car Brand List Page

Now when you publish this extension to business central the table and page will appear as shown below.

Navigate to tell me in business central and search for the car brand and it will give you a list of the car brands and administration page where you create your car brand data.

Administration Page

List Page

Most important to expose the Business central data/table to Datvaerse we need to create API in visual studio code below is the API code.

As a next step, publish the extension and wait for a few min you would see the Car Brand table in Available Business Central Table in Dataverse.

Open Available Business Central Table and navigate to Data, look for Car Brand.

Select the record and click on the edit record button in the command bar, it will redirect to a new page where check the visible field click on save and close.

After a few seconds in the list of Microsoft Dataverse tables, you will find a Car Brand entity with the name dyn365bc_carbrand_bctech_demo_v1_0. In this case, you will know that this entity is created from the Dynamics 365 Business Central list of entities.

Open CarBrand, and again navigate to Data, and Microsoft Dataverse will show you all lists of items from Dynamics 365 Business Central.

In this way, We have successfully fetched custom table data from business central to Dataverse using the Business central virtual table concept.

I hope this will help you.

Learn, Evolve & Share..!

Dynamics 365 Business Central Virtual Table with Dataverse

Recently, While doing a POC, I wanted to check the capabilities of storing business central data into Dataverse, while doing the same I came across an amazing feature developed by Microsoft which is Business Central Virtual Table which is in (Preview) mode currently.

In this blog post, I will show you how you can configure from scratch the Dynamics 365 Business Central Virtual table with Microsoft Dataverse.

Wait, before enabling this we need to integrate Dynamics 365 Business Central with Dataverse, click here to see how to integrate Business central with Dataverse.

Once Dynamics 365 business central is integrated successfully with Dataverse, The first step is to navigate to your Power Platform environment and then select Dynamics 365 Apps and click Open AppSource.

Next, we need to install the Business Central Virtual Table (Preview) app.

Click on the Get it now button you will be redirected to the Power Platform Admin Center, and a new pop-up will open.

Select your Power Platform environment for which you want to enable Business Central Virtual Table (Preview) app.

Check terms and conditions and click on install.

After a few minutes, refresh your browser and installation should be done, and Status will be Installed.

Now, navigate to Microsoft Dataverse tables filtered All in the upper right corner and search for the Business Central Virtual Data Source Configuration table.

Open Business Central Virtual Data Source Configuration table, navigate to Data, select Business Central, and click Edit record on the header.

A new tab will open, where we need you to provide Business Central information.

Specify the Environment Name and the Default Company click save and close.

Now, Navigate back to business central where we need to configure Azure Active Directory Applications. Search for the Azure Active Directory Applications from TellMe.

Open AADA & in the State field select Enabled.

Once this setup is completed, we need to enable virtual entities that will pull data to Microsoft Dataverse from Dynamics 365 Business Central.

Navigate to Microsoft Dataverse Tables and find the table called “Available Business Central Table”.

Open Available Business Central Table, navigate to Data, here you will get a list of all standard and custom entities.

To enable standard Dynamics 365 Business Central entity inside Microsoft Dataverse you should select one of the entities, for example, Item, and click Edit record.

It will redirect you to a new page, where you will see basic information about the Dynamics 365 Business Central entity. Here click Visible and after that Save & Close.

After a few seconds in the list of Microsoft Dataverse tables, you will find an Item entity with the name dyn365bc_item_v2_0. In this case, you will know that this entity is created from the Dynamics 365 Business Central list of entities.

Open Item, and again navigate to Data, and Microsoft Dataverse will show you all lists of items from Dynamics 365 Business Central. In case you don’t see all fields, change in the upper right corner view.

We have successfully fetched data from business central to Dataverse using the Business central virtual table concept.

Isn’t it cool..! 😎

Now, you all are thinking about custom tables, how we can fetch data from Business Central custom table to Dataverse.

I hope this will help you, Stay tuned will be discussing the custom table concept in my next blog.

Learn, Evolve & Share..!

Integrate Dynamics 365 Business Central with Dataverse

In this post, we will walk through how we integrate Dynamics 365 Business Central with Dataverse.

Note: Before Integrating keep Below things in mind

  1. We need to use the Admin login, while doing all the steps to setup these environments.
  2. The Base Currency of Business Central & Dataverse Environment should be same else you will run into issue.

If the currencies of Business Central and Dataverse do not match, the below error will display.

LCY Code XXX does not match ISO Currency Code XXX of the Dataverse base currency.

As you are all aware the base currency defined for Dataverse after setup is not possible to change however, you can match it in Business Central by changing LCY Code in General Ledger Setup.

Business Central environment

Dataverse Environment

Let’s start to integrate D365 BC with Dataverse

Navigate to Dynamics 365 Business Central and search for Assisted Setup.

You will find below options

From Assisted Setup under Connect with other systems group choose Set up a connection to Dataverse, as shown below.

This will start the Setup wizard, just follow and provide your information asked on each page.

Click Next to Start configuring Business Central & Dataverse connection.

Here you can select your Dataverse Environment or can enter manually, above screen shows where you can find this URL from.

Sign in with an administrator user account and give consent to the application that will be used to connect to Dataverse.

Choose Sign in with administrator user.

After Signing in with the administrator user turns green and bold, choose Next.

Select Ownership as Team/Person and Click Next.

Click on Finish to complete the Setup.

You can verify synchronizations recommendation by clicking on “Show Synchronization recommendation” as shown above.

Next, open the Dataverse Connection Setup from TellMe.

Click on Connection and select Test Connection.

You will get a Test success prompt if it is successful.

For more details, you can check Microsoft Documentation here.

I hope this will help you.

Learn, Evolve & Share..!

What is Dynamics 365 CRM Workflows?

Microsoft Dynamics 365 workflows allow you to automate simple and complex business processes within Dynamics. Workflow processes run in the background or in real-time and can optionally require a user input. Workflows in Dynamics 365 provide further utility in that they often act as an alternative to building a custom plug-in. Workflows can be triggered based on specific conditions or can even be started manually by the users.

To configure workflow below are the major steps to follow:

  • Select the entity on which the workflow will run.
  • Configure whether the workflow will run synchronously or asynchronously.
  • The Event (message) on which the workflow will run.
  • The scope in which the workflow will run.
  • The actions (steps) and stages of the workflow.

Difference between Synchronous/Asynchronous Workflow:

When you create a workflow, you will see the option of Run this workflow in the background (recommended) which determines whether the workflow will run in real-time (synchronously) or in background (asynchronously).

Synchronous Workflows: If the user must be involved in the conversation. Synchronous means that next operations cannot be performed until this operation is finished.

Asynchronous Workflows: Asynchronous workflows run in the background – the execution would not start immediately, and the user does not have to wait until the workflow completes.

Workflow Messages:

Workflows can be registered on specific events as follows:

Record is created: Workflow will begin when a record is created within the selected entity.

Record status changes: Workflow will begin when a record status is changed within the selected entity.

Record is assigned: Workflow will begin when a record is assigned to someone within the selected entity.

Record fields changes: Workflow will begin when a record field changes within the selected entity. See below snapshot for example.

Record is deleted: Workflow will begin when a record is deleted within the selected entity.

Workflow Scope:

Workflows allow you to set the scope in which the workflow will run. Following are the supported workflow scopes :−

User: Workflow will run only on the records owned by the same user as the workflow user.

Business Unit: Workflow will run on the records owned by the users of the business unit same as the workflow user.

Parent: Child Business Units: When this option is selected, the Workflow will exclusively run on records owned by the users of the business unit same as the workflow user as well as any child business units.

Organization: When this option is selected, the Workflow will run on records owned by any user.

Workflow Components:

Workflows in Dynamics are a combination of series of steps which the workflow will follow. You can even divide these steps in logical stages.

Following steps are supported by Dynamics workflows:

Stage: A stage is used to split a workflow into manageable sections.

Conditional Steps:

  1. Check Condition: Specifies a logical “if (condition) – then” statement.
  2. Conditional Branch: Specifies a logical “else – if – then” statement. This can only be used with a Check Condition.

Action Steps:

  1. Create Record: Creates an entity record (or a related entity record) in selected entity.
  2. Update Record: Updates selected entity record (or related entity record) field with desired value, or with a dynamic value.
  3. Assign Record: Assigns selected entity record (or a related entity record) to a user or a team.
  4. Send Email: Sends an e-mail via new e-mail creation or via e-mail template.
  5. Perform Action: Specifies the custom workflow steps (and actions).
  6. Change Status: Changes status field of selected entity record.
  7. Stop Workflow: Stops the workflow with a status of completed or cancelled.

To check workflow status follow below steps:

Microsoft Dynamics 365 allows us to monitor running workflows in a couple of areas in the system. This allows us to check the progress of running workflows for errors or logic that may have not been considered when designing the workflow.

In the Process Sessions area within workflow we can see the records impacted by the workflow.

Or under Settings in the System Jobs area we can see all workflow statuses

In this way, you can build your workflows and start automating your business scenarios.

I hope this will help you.

Learn, Evolve & Share..!

Rollup Field Error – Record currency is required to calculate rollup field of type currency

One of my recent MS CRM development, I have come across with rollup field error i.e. Record currency is required to calculate rollup field of type currency.

Read the blog completely to know how we can solve this error.

I have added a new Rollup field of type ‘Currency’ to my existing custom entity ‘Sales Invoice’, which ‘SUM’ up the currency field’s data from related entity ‘Sales Invoice Line’.

After customization, when I have open the Sales Invoice Line entity to add line item following error showed up.

Note: This error would occur, only those records created before the new Rollup field added to the entity, since they will not contain valid data in the Currency (TransactionCurrencyId) field.

To examine this, I added the OOB ‘Currency’ field to the form and, it was blank.

Resolution:-

Set the ‘currency’ field manually, which will fix this issue.

Now Add the ‘Sales Invoice lines’ which will calculate the rollup field.

Note: If you have created records before adding the rollup field to record and the records are trivial then delete them all as the records created after the addition of the Rollup field, should automatically have the currency field set, and the rollup field will work correctly.

I hope this will help you.

Learn, Evolve & Share..!

A Guide On Dynamics 365 Sales Lead Troubleshooting (For Sales People)

Use the following list of troubleshooting topics to quickly find information to solve your Dynamics 365 Sales lead-related issues.

Lead Qualification Issues and Resolution

Issue:- How do I convert or qualify my leads?

When Salesperson/User determines that the lead they are working with has the potential to turn into a business, they qualify a lead.

When you qualify a leads, it become Opportunity.

To Qualify a lead select “Qualify” button on the command bar on lead record.

You can also Qualify lead from the list of leads.

  1. Navigate to Sales > Lead
  2. This will present you with the list of Leads in the system.

3. Select the lead you want to qualify and on the command bar, select Qualify.

Issue:- Why am I not able to qualify a lead?

Scenarios:-

There could be multiple errors you may get while you qualify a lead.

  1. Active Stage is not on “Lead” entity.
  2. To move to the next stage, complete the required steps.
  3. Duplicate Warning – There might be a record found for account or contact, If so, please select that.
  4. Access denied or insufficient permission.

Resolutions:-

The following sections talk about each of these errors and how you can resolve them.

  1. Active Stage is not on “Lead” entity.

Reason:- The Lead you are trying to qualify isn’t in a Active stage, this may happen when an already-qualified lead has been reactivated.

Resolution:-

Step:-1 Open the lead record.

Step:-2 On the Qualify process stage, select the Set Active button. Now, you can able to qualify a lead.

2. To move to the next stage, complete the required steps.

Reason:- You have not filled in data in all the business-required fields in the current stage of the process stage.

Resolution: Fill in data in all the mandatory fields in the current stage, save the record, and then try qualifying the lead again.

3. Duplicate Warning – There might be a record found for account or contact, If so, please select that.

Reason:- When the lead is qualified to an opportunity, it automatically creates a corresponding account and/or contact and there may already be a match for this account or contact.

Resolution:- On the Duplicate warning dialog box, select the existing account or contact to avoid creating duplicates. To create a new record instead, click Continue.

4. Access denied or insufficient permission.

Reason:- You do not have sufficient permissions on the lead record.

Resolution:- Ask your system administrator to grant you the necessary permissions.

I hope this will help you.

Learn, Evolve & Share..!

A Guide On Dynamics 365 Sales Lead Troubleshooting (For Administrators)

Use the following list of troubleshooting topics to quickly find information to solve your Dynamics 365 Sales lead-related issues.

Lead Qualification Issues and Resolution

Issue:- Insufficient permission or access denied error when a user is trying to qualify a lead.

Scenarios:- How you resolve the error depends on the following ownership scenarios for the lead records.

  1. The lead that the user is trying to qualify is in their business unit.
  2. The lead is owned by the user trying to qualify it.
  3. The lead that the user is trying to qualify is in their organization.

Resolutions:-

Scenario 1: The lead that the user is trying to qualify is in their business unit.

Step 1:- Navigate to Settings -> Security -> Security Roles.

Step 2:- Open assigned user security role. (In our case security role is “Sales Person”).

Step 3:- On Core Record tab Assign Create, Read, Append, and Append To permissions to the user ’s Security Role at Business Unit level on the following entities:

a. Account

b. Contact

c. Lead

d. Opportunity

Step 4:- Assign Read access to any custom entity on Custom Entities tab.

Step 5:- Assign Read access to Attribute Map, Customization’s, Entity Map on Customization tab.

Scenario 2:- The lead is owned by the user trying to qualify it.

Step 1:- Navigate to Settings -> Security -> Security Roles.

Step 2:- Open assigned user security role. (In our case security role is “Sales Person”).

Step 3:- On the Core Records tab, assign Create, Read, Append, and Append To permissions to the Security Role at User level on the following entities:

a. Account

b. Contact

C. Lead

d. Opportunity

Step 4:- On the Customizations tab, assign Read access to Attribute  Map, Customizations,  Entity and Entity Map.

Step 5:- Assign Read access to any custom entity On the Custom Entities  tab.

Scenario 3:- The lead that the user is trying to qualify is in their organization.

Step 1:- Navigate to Settings -> Security -> Security Roles.

Step 2:- Open assigned user security role. (In our case security role is “Sales Person”).

Step 3:- Assign Create, Read, Append, and Append To permissions to the user’s Security Role at Organization level on the following entities:

a. Account

b. Contact

c. Lead

d. Opportunity

Step 4:- Assign Read access to any custom entity On the Custom Entities tab.

Step 5:- On the Customization tab, assign Read access to Attribute  Map, Customization’s,  Entity and Entity Map.

I hope this will help you.

Learn, Evolve & Share..!

A Guide On How-to Setup Dynamics 365 30 Days Online Trial

Beginner always has a question on how to get hands-on practice with Microsoft Dynamics 365.
Creating A 30-day Dynamics 365 trial will help you to start your journey, and this article will tell you all about how you can benefit from it.

Follow below steps to setup 30 days Dynamics 365 trial.

Step 1: To Create a Dynamics 365 trial Click Here and click on sign up here.

it will open a wizard now click on No, continue signing up

Step 2: Give your personal information and click next.

Note: If you have already account with Microsoft for other services it will ask you to sing in and continue or you can click on create new account instead.

Step 3: Click Next it will ask you for mobile verification select option from Call Me or Text Me on the wizard and click on Send Verification Code enter the One Time Password and click on Verify.

Step 4: Create your business identity give a custom domain name and click on check availability and click on next.

Step 5: Create User Id and Password to login Dynamics 365 CRM Trial click on Sign Up.

Step 6: Please allow system for some time, a Trial Version will be created for your account. You can see the progress. once completed click on Let’s go.

Step 7: Click on set up and select the required scenario suits you best.

I am selecting None of this. Don’t Customize my organization and click on complete setup.

Step 8: Dynamics 365 CRM trial Organization will be ready in few minutes.

Step 9: After completion of Set up, System will navigate to the CRM Trial Organization.

Step 10: As you can see we don’t have any sample data on CRM Trial. Click Here for my previous post and install Sample data in Dynamics 365 CRM.

I hope you have successfully create a Dynamics 365 Trial and installed sample data.

Learn, Evolve & Share…!

A Guide On How to Install/Uninstall Sample Data in Dynamics 365 CRM?

After creating a 30 Day Dynamics 365 CRM Trial account user always need to install sample data to get hands-on practice with Microsoft Dynamics 365 this article will tell you all about how you can Install and Uninstall Sample Data in Dynamics 365 CRM.

Follow the below steps to Install/ Uninstall Sample Data from Dynamics 365 CRM Online.

Step:1 Open Dynamics 365 CRM Navigate to Settings -> Data management and Click on Sample Data.

Step 2:  If you have not installed any Sample Data earlier, wizard will show Sample Data button. Click on it to import sample data given by Dynamics 365 CRM Out Of The Box.

Step 3: Now, Navigate to Imports under Data Management to see the Sample Data import records Status.

Step 4: Once all the records Status Reason change to Completed, we can able to see the Sample records in the System.

For an Instance, below is the Account Sample Data imported during this operation.

Step 5: If you want to Uninstall the same data imported during this operation, Navigate to Settings -> Data Management and click on Sample Data.

Then click on Remove Sample Data button.

Step 6:  Navigate to Settings -> Data Management -> Bulk Record Deletion to see Records deletion status.

I hope you have learn something.

Learn, Evolve & Share...!