How to Configure Web Services in Dynamics 365 Business Central

Posted on Posted in Microsoft Dynamics 365 Business Central

Target Audience: Technical

Benefit: User can enable or disable the web services easily

Introduction:

Web services are lightweight method which could allow applications to become functional for the external systems and users. Dynamics 365 Business Central Objects published as web services which could be beneficial for the users to access the metadata through network.

This article explains on how to configure the web services in Business Central by using Visual Studio Code with AL Language Extension. The steps are shown as below:

Steps:

1. Create a Setup Page which consist of Boolean variable, for example: ‘SetupExtension’ and create a field which have value, for example: ‘SetupExtension Variable’.

2.  In the OnOpenPage trigger, write a function code, for example: ‘CheckifServiceExists’ is to check whether the Web Services are already created based on ‘SetupExtension’ Boolean field.

https://www.cloudfronts.com/wp-content/uploads/2018/12/OnOpenPage-Trigger.png

https://www.cloudfronts.com/wp-content/uploads/2018/12/LocalProcedure-CheckifServicesExists.png

3. In the OnQueryClosePage trigger below, user can create or delete the web services easily based on the ‘SetupExtension’ Boolean.

Remarks:

SetupExtension’ Boolean = ‘TRUE’, Web Services is created successfully

SetupExtension’ Boolean = ‘FALSE’, Web Services is deleted successfully

https://www.cloudfronts.com/wp-content/uploads/2018/12/OnQueryClosepage-Trigger.png

4. Below are the two configuring outputs of the web services:

  • When ‘SetupExtension’ Boolean set as ‘TRUE’. The Web Services will be created successfully as shown in the screenshot below:

https://www.cloudfronts.com/wp-content/uploads/2018/12/When-SetupExtension-is-TRUE.png

https://www.cloudfronts.com/wp-content/uploads/2018/12/After-Setup-Webservices.png

  • When ‘SetupExtension’ Boolean set as ‘FALSE’. The Web Services will be deleted successfully as shown in the screenshot below:

https://www.cloudfronts.com/wp-content/uploads/2018/12/Deleted-Webservices.png https://www.cloudfronts.com/wp-content/uploads/2018/12/Webservices-Delete-Message.png

Conclusion:

Therefore, follow the steps as mentioned above, users able to create or delete the web services easily with a correct method.

Leave a Reply

Your email address will not be published. Required fields are marked *