Creating a Webservice for Extension in MSDYN365BC.

Hi Readers,

Once we have created our Extension, we might need to auto Publish the web service when we install the Extension in Microsoft Dynamics Business Central.

If you want to Learn to create Extension in Microsoft Dynamics Business Central you can refer to Customer Requirement for AL Development.

To create web service while installing the extension, we have two method

  1. Create Install Codeunit.
  2. Create XML File.

Create Install Codeunit for MSDYN365BC

Below is the example of Install only Codeunit.

An install codeunit includes AL methods for performing operations unconcerned with the extension code itself during the initial installation and the reinstallation of an extension.

The Install codeunit started and the OnInstallAppPerCompany trigger does the work of publishing the web service.

When you install the Extension , below mentioned web service gets publised with Object Type PAGE , Object Id 50000 and Name InsuranceWS.

Create XML File.

We can use Snippet twebservices to create XML File.

You can define Object Type as mentioned below.

5 for Codeunit

8 for Page

9 for Query

Once you publish and install the extension you will find the new web service.

When you install the Extension , below mentioned web service gets publised with Object Type Codeunit , Object Id 50000 and Name InsuranceCUWebService.

Note: It’s recommended to use XML file because when you uninstall the extension, if the web service is published using the XML definition file it is automatically removed from the Tenant Web Service table while uninstalling the extension.while if the web service is published directly via AL code, it’s not removed from that table.

Hope this helps you for selecting an option for creating permission for you extension.

To get new updates and learn about Microsoft Dynamics 365 Business Central  Microsoft Learn and Self Learning

Download Link for different version of NAV and Business Central

Happy Reading.

Divyesh Chitte

Connect  – Twitter | Facebook | Linkedin 
Follow    – Blog | Facebook Page  | DynamicsCommunity

2 thoughts on “Creating a Webservice for Extension in MSDYN365BC.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s