Target Audience: Technical
Benefit: User can enable or disable the web services easily
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:
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.
3. In the OnQueryClosePage trigger below, user can create or delete the web services easily based on the ‘SetupExtension’ Boolean.
‘SetupExtension’ Boolean = ‘TRUE’, Web Services is created successfully
‘SetupExtension’ Boolean = ‘FALSE’, Web Services is deleted successfully
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:
- When ‘SetupExtension’ Boolean set as ‘FALSE’. The Web Services will be deleted successfully as shown in the screenshot below:
Therefore, follow the steps as mentioned above, users able to create or delete the web services easily with a correct method.