Dynamics 365 Business Central SOAP Web Service Setup (Purchase Invoice)

Publish Purchase Invoice Web Service

This document is applicable for Dynamics 365 Business Central. Gorilla Expense integrates with Dynamics 365 using web services provided by Dynamics 365 Business Central. The first step is to create the “Purchase Invoice” web service in Dynamics 365. Web service setup can be accessed in Dynamics 365 searching for “Web Service”

 

Figure 1

Create a new service, by selecting Object Type as “Page”, Object Id as 51 for Purchase Invoice, service name as PurchaseInvoice and make sure the “Publish” checkbox is checked.

Figure 2

 

Make sure the new web service is called PurchaseInvoice (no spaces in between and capital sensitive letters) and published checkbox is checked as shown above.

Once the above steps are completed, copy the URL from the field called “SOAP URL”.  And provide it to Gorilla Expense team. Repeat this on for all companies. Example SOAP URL will look like mentioned below

https://api.businesscentral.dynamics.com/v2.0/59acb64d-7f3d-4920-b40e-e3567a44d24e/Production/WS/CRONUS%20USA%2C%20Inc./Page/PurchaseInvoice

On opening on the URL in a web browser, the following page should show up.

Figure 3

Enter your web service credentials. Refer the link here to find how you can get your Web Service Credentials. Upon entering the credentials, verify that this page opens on all PCs (in Accounts Payable department) that will be used to export expense reports to Dynamics 365 using Integration Manager

Figure 4

Web Service Credentials 

When you try to open the above URL, it will ask you to enter credentials. Here is how you find the credentials –

  1. Go to Users -> open your user card

Figure 5

  1. Generate Web Service Keys by clicking on the three dots shown below 

Figure 6

 

  1. Set the key expiration as per your company policy. In this case, we have set it to not expire.

Figure 7

  1. Click OK. A key will be generated and placed in the Web Service Key field shown in Figure 5. Copy it - This will be your password. Copy the username from the username field shown in figure 5.

Gorilla Expense Integration Manager Setup

Integration Manager is used to send approved expenses into Dynamics 365. Download and install Integration Manager from the following URL – https://www.gorillaexpense.info/install/publish.htm

Once installed, select MS NAV/MS Dynamics 365 in the Type dropdown on the top section on the login page and login using Gorilla Expense Admin username and password. Enter the following URL of Gorilla Expense Service in the Login URL field. For Outside-USA based customers, this value can be found in the Admin Application Access Instructions Document (Integration App Section) provided to you after the Gorilla Expense setup is completed. 

https://www.gorillaexpense.info/Gorillapro/service (This link will not open in the browser and that is OK)

Once logged in, select File - > Export Expense Reports. All the expenses available for exporting to Dynamics 365 (Manager Approved Expenses) will show up (if any). Click on settings button available on the right top corner – a new window called “NAV Mappings” shows up (see screenshot below). On this window, you can define what fields are to be mapped to the Purchase Invoice Line Description field. Also, on this screen you have to enter the Dynamics 365 Connection URL mentioned in the Dynamics 365 Web Service Setup section -

https://api.businesscentral.dynamics.com/v2.0/59acb64d-7f3d-4920-b40e-e3567a44d24e/Production/WS/CRONUS%20USA%2C%20Inc./Page/PurchaseInvoice

Customers with multiple company databases - If you check the “Get Connection URL from Company Profile”, then it is not required to enter the above URL on the “NAV Mappings” screen, but you will instead have to login to the web application and enter it on the company master (Masters->Company) when logged in as admin – if you have provided the URL to Gorilla Expense team, they will take care of this for you. This provision is provided especially for customers who have multiple Dynamics 365 company databases. However, this setting can be used for single Dynamics 365 DB as well. 

Check the “Post To Purchase Invoice” checkbox, and if applicable, map the desired dimensions after consulting with Gorilla Expense team. You need to enter the Dynamics BC user/password information – refer to the “Web Service Credentials” section for your username and password. Check the radio button ‘Dynamics 365’ and radio button ‘SOAP’ in the Integration Type section. Then click Save. Once the settings are saved, you are ready to push expenses to Dynamics 365.