How to fetch a custom table created in Business Central into PowerApps using CDS and Odata.
Introduction: In this blog, I have introduced how to fetch a custom table from Microsoft Dynamics 365 Business Central into Microsoft PowerApps using Common Data Service(CDS) and OData. The table that was created in Business Central was fetched into a custom entity(MatchingLists) in CDS that allows me to create a local database in PowerApps for storing the entity data and OData that helps to fetch and integrate the data. Pre-requisites: Microsoft Dynamics 365 Business Central Microsoft PowerApps Steps: 1. Create a custom entity within Common Data Service(CDS) whose data you want to retrieve from Business Central. 2. Add the fields with their required data types. 3. Get Data from Business Central using OData Integration. 4. Go to web services in Business Central, add the custom page in the web services and use its OData V4 URL. 5.Enter the OData URL and the Organization credentials. 6. You will be shown the list of tables in each and every company. 7. Go to the table whose data you want to get into PowerApps, and select that table. 8. Next is to select the entity to be mapped with this table and field by field mapping of the same. 9. Refresh can be set manual or automatically, if automatic then select the time. 10. Create a list structure to dsiplay the table.
Share Story :
To create a Customer Record from Microsoft PowerApps to Microsoft Dynamics 365 Business Central and vice-versa.
Introduction: This blog explains how to create an application in Canvas PowerApps that can integrate the data from the App to Business Central and vice-versa. I have created an app that on creation of a Customer record will create the record in Business Central and the same in opposite direction. Pre-requisites: Microsoft PowerApps Microsoft Dynamics 365 Business Central Steps: 1. Go to PowerApps, select create an app from blank and select the Business Central connection of your tenant. 2. Select the Company and the Customer table. 3. The basic design of the screen is created where you can view the list of customers, you can also edit the view as per your requirements. 4. The ‘+’ sign on the screen is used to add a new customer record. Logic behind the button is: NewForm(EditForm1);Navigate(EditScreen1, ScreenTransition.None) 5. Add the Customer Details and click on the submit button to submit the record or cancel button to go back to the main screen. Logic for submit: SubmitForm(EditForm1) Logic for cancel: ResetForm(EditForm1);Back() 6. The Customer record is created both in the PowerApps as well as Business Central. 7. Now create a new Customer Record in Business Central. 8. Now go to Powerapps, on the main screen click on the Refresh button the customer record will be created in the list. Logic for Refresh: Refresh(customers)
Share Story :
Customer Approval In Business Central Using MS Flows
Introduction: Microsoft Flows is a cloud-based software tool that allows to create and automate workflows across multiple applications. Here, I have created a flow for Customer Approval using MS Flows, where a customer which is created in Business Central can be notified to the particular user using Outlook. Pre-Requisites: Microsoft Dynamics 365 Business Central MS Flows Procedure: 1)First you need to do the SMTP Mail Setup from the Business Central to send the notification. 2) Go to MS Flows, select Create from blank to create a new flow. 3) From the list of connectors, select the Business Central Connector and in Trigger select “When a Customer Approval is Requested”. 4)Select the Business Central Company and add the conditions you want to add for Customer Approval. 5) Add the action or condition to be executed on the trigger. 6) Here, I have added the Outlook action to send a mail to the admin when a customer is created. 7) A Customer is created in Business Central and when we click on Send Approval Request for Customer Approval, a mail is sent to the particular person in outlook mail.
Share Story :
To make the Business Central WebClient Accessible Externally
Introduction: In this blog , I will demonstrate the use of SSL certificates to help secure connections over a wide area network (WAN), connection from the Business Central Web Server to the Business Central Server. Business Central can support the following configurations: Chain trust, which specifies that each certificate must belong to a hierarchy of certificates that ends in a root authority at the top of the chain. Peer trust, which specifies that both self-issued certificates and certificates in a trusted chain are accepted. The implementation in this section describes the chain trust configuration, which is the more secure option. Pre-requisites: 1. Microsoft Dynamics 365 Business Central 2. SSL Certificates Demonstration: 1. Obtaining Certificates: You implement chain trust by obtaining X.509 service certificates from a trusted provider. These certificates and their root certification authority (CA) certificates must be installed in the certificates store on the computer that is running Microsoft Dynamics 365 Business Central Server. The CA certificate must also be installed in the certificate store on computers that are running the Business Central Web Server so that clients can validate the server. 2. Run the Certificates Snap-in for Microsoft Management Console and Install and Configure the Certificates. (NOTE: The Server Authentication and Client Authentication purposes must be enabled.) 3. Grant access to the Business Central Server service account: After you have installed the root CA and the service certificate on the computer running Business Central Server, you must grant access to the service account that is associated with the server so that the service account can access the service certificate’s private key. In the left pane of MMC, expand the Certificates (Local Computer) node, expand the Personal node, and then select the Certificates subfolder. In the right pane, right-click the certificate, select All Tasks, and then choose Manage Private Keys. In the Permissions dialog box for the certificate, choose Add. In the Select Users, Computers, Service Accounts, or Groups dialog box, enter the name of the dedicated domain user account that is associated with Business Central Server, and then choose the OK button. In the Full Control field, select Allow, and then choose the OK button. In the right pane, select the certificate. In the Certificate dialog box, choose the Details tab, and then select the Thumbprint field. Copy the value of Thumbprint field. For example, copy the hexadecimal characters to text editor, such as Notepad. Delete all spaces from the thumbprint string. If the thumbprint is c0 d0 f2 70 95 b0 3d 43 17 e2 19 84 10 24 32 8c ef 24 87 79 then change it to c0d0f27095b03d4317e219841024328cef248779. 4. Configure the Business Central Server instance: Enter the service certificate thumbprint and the credential type as ‘NavUserPassword’ and restart the server. 5. In the Windows Client Configuration file (ClientUserSetting.config ) and the Web Client Configuration file (NavSettings.json) make the credentials as ‘NavUserPassword’ and the DNSIdentity as the subject name of the certificate. The location of Windows Client Configuration file is Users\<username>\AppData\RoamingLocal\Microsoft\Dynamics 365 Business Central\. The location of Web Client Configuration file is C:\inetpub\wwwroot\BC130\navsettings.json. 6. Now go to IIS and set the bindings for https ( hostname will be the domain name of the server) and in SSL certificate select the CA Root certificate. 7. Now add the CA Root certificate in the external computer and enter the link for WebClient in the browser. (https://<Domain Name>/BC130) Conclusion: Thus, we have accessed the WebClient externally using the SSL.
Share Story :
Comparison of the API for Business Central on-premise and Business Central on Cloud
Introduction: This blog is to give an introduction regarding how to integrate the data from Business Central to an API and also gives a comparison of the API integration in Business Central on-premise and Business Central on Cloud. I will demonstrate it with an example for Sales Order Entity. Pre-requisites: 1. Microsoft Dynamics 365 Business Central (on-premise) 2. Microsoft Dynamics 365 Business Central (Cloud) Demonstration: For Business Central on-premise: 1. Add the page whose data has to be integrated to the page API Setup (5469) and click on Integrate APIs. 2. Go to Business Central Administration and to the Server Instance properties and in the OData properties check the “Max Page Size” parameter and set it to the number of records you want to integrate. (Note: Enable API Services and Enable OData Services checkboxes should also be ticked.) 3. Now go to the browser and enter the URL to get the list of 44 standard APIs. (Format of the URL for Business Central on-premise is given as follows: “http:<<Server Name>>:<<Odata Port>>/<<Service Name>>/api/beta/” 4. Now you can get to the sales order using the following URL. “http:<<Server Name>>:<<Odata Port>>/<<Service Name>>/api/beta/companies(company id)/salesOrders”. This data is available in JSON format and further can be confirmed that there are 1500 records. Thus, the number of records integrated here depends on the Max Page Size parameter. For Business Central on Cloud : 1. First add the page whose data has to be integrated is added to the API Setup Page similar as above. Use the following URL “https://api.businesscentral.dynamics.com/v1.0/<tenant domain>/api/beta to access the API for getting the data from the Business Central on Cloud. Enter the username of the user in the Business Central and the Password will be the user’s WebServiceAccessKey. 2. When you click on Sign in, you will get a list of all of the standard 44 APIs. 3. Similar to the Business Central on-premise you can navigate to the SalesOrder. URL Format is as follows: “https://api.businesscentral.dynamics.com/v1.0/<tenantdomain>/api/beta/companies(company id)/salesOrders”. It can be seen from the images below that only 1000 records have been integrated from the SalesOrder in Business Central to the API. Here, as there is no administration this number of records integrated cannot be changed and they remain as the standard defined for OData. Conclusion: This is the difference in the API integration in Business Central on-premise and Business Central on Cloud. It also shows the number of records that can be integrated in Business Central on-premise and Business Central on Cloud. As we will find the solution as to how to alter the number of records that can be integrated in Business Central on Cloud we will post the blog.
Share Story :
Microsoft Dynamics 365 Business Central and Microsoft Dynamics 365 for Sales Integration
Introduction: If you use Microsoft Dynamics 365 for Sales for customer engagement then you can use Microsoft Dynamics 365 Business Central for order processing and finances and have seamless integration in the lead-to-cash process. When you integrate you application with sales, you can have all the access to Sales data from Business Central and the other way around in some cases. Thus, Integration enables you to work with and synchronize data types that are common to both services, such as customers, contacts, and sales information, and keep the data up to date in both locations. Pre-requisites: Microsoft Dynamics 365 Business Central Microsoft Dynamics 365 for Sales Demonstration: Steps for Integration: 1. Business Central and Microsoft Dynamics 365 Setup Go to Business Central, in the Setup and Extensions select Assisted Setup. Select Set up Dynamics 365 for Sales Connection for establishing a connection between Business Central and Sales in Microsoft Dynamics 365. In the textbox, Insert the link of the Microsoft Dynamics 365 Sales. Click on Next and insert the Email and Password for the user that will be used for Synchronization between Business Central and Microsoft Dynamics 365 Sales. Click on Finish. Then insert the credentials of the user account which must be used to import the solution. The user account must have Security Roles of System Administrator and Solution . 2. Couple Business Central Salespeople to Microsoft Dynamics 365 User Before a customer can be synchronized to an account, the salesperson that is assigned to the customer must be coupled to a user in Sales. Go to that Salesperson and in navigate select Coupling. A coupling provides the basis for integrating records in Microsoft Dynamics 365 with records in Business Central. Essentially a coupling associates or links a Microsoft Dynamics 365 record to a Business Central record. Hence, coupling needs to be setup for integration. Select the CRM user you want to synchronize the Salesperson with and click on OK. If you want to synchronize data in the account in Microsoft Dynamics 365 and the customer in Business Central, set the Synchronize After Coupling field to one of the following options. Yes – Use the Business Central Data : Copies the data from mapped fields of the customer in Business Central to the account in Microsoft Dynamics 365. Yes – Use the Dynamics 365 Sales for Data: Copies the data from mapped fields of the account in Microsoft Dynamics 365 to the customer in Business Central. 3. Couple Business Central customers to Microsoft Dynamics 365 In the Customer table of Business Central, select the customer you want to couple with Account in Microsoft Dynamics 365 Sales. Set the Coupling of the Customer with the related Account in Microsoft Dynamics 365 and click on OK. 4. Couple Business Central Unit of Measures to Microsoft Dynamics 365 Units Groups In the Unit of Measure table of Business Central, select the Unit of Measure you want to couple with the Unit Group in Microsoft Dynamics 365 Sales. Set the Coupling of the Measure with the related Unit Group in Microsoft Dynamics 365 and click on OK. 5. Couple Business Central Currencies with Microsoft Dynamics 365 transaction Currency In the Currencies table of Business Central, select the Currency you want to couple with the Transaction Currency in Microsoft Dynamics 365 Sales. Set the Coupling of the Currency with the related Transaction Currencies in Microsoft Dynamics 365 and click on OK. 6. Couple Business Central items to Microsoft Dynamics 365 products In the Items table of Business Central, select the item you want to couple with the Product in Microsoft Dynamics 365 Sales. Set the Coupling of that item related to the Product in Microsoft Dynamics 365 and click on OK. 7. Sales Order Integration Create a Sales Order in Microsoft Dynamics 365 and when submitted it appears in Business Central. After submitting sales order, in the search box of Business Central enter Sales Orders, and then choose the related link. In the Sales Orders window, on the Navigate tab, in the Dynamics 365 for Sales group, choose Sales Order List. The Microsoft Dynamics 365 Sales Orders windows opens to display a list of only sales orders in Microsoft Dynamics 365 that have their status as Submitted. Select the Create in Central Business Action to get the Sales Order in Business Central. 8. Sales Invoice Integration On selecting the post action, a posted invoice is generated in Business Central and the status of the Order changes from Submitted to Invoiced. Status changed to Invoiced. In the Posted Sales Invoice window of Business Central, on the Navigate tab, in the Dynamics 365 Sales group,choose Create Invoice in Dynamics 365 for Sales. Go to Microsoft Dynamics 365 check the Invoices. Conclusion: Thus, we have integrated Microsoft Dynamics 365 Business Central and Microsoft Dynamics 365 for Sales. The table below indicates the direction of mapping of different Data Types. Sr No. Business Central Entity Mapping Direction D365 Entity Default Filter 1 Salespeople/Purchaser Sales -> Business Central User Sales contact filter: Status is No, User Licensed is Yes, Integration user mode is No 2 Customer Business Central -> Sales and Sales -> Business Central Accounts Sales account filter: Relationship Type is Customer and Status is Active. 3 Unit of Measure Business Central -> Sales Unit Groups 4 Currency Business Central -> Sales Transaction Currency 5 Items Business Central -> Sales and Sales -> Business Central Product Sales contact filter: Product Type is Sales Inventory 6 Sales Order Sales -> Business Central Sales Order 3 Posted Sales Invoice Business Central -> Sales Invoice