Wednesday, December 19, 2018

MSDYN365BC - AL Development 05 - Publish Extension.

Hi Readers,

I hope you were able to follow what we have done till now on Last articles in this series. If you haven't read the earlier article, then Refer to Table of content.

Till now we have developed some new tables and pages and customized base objects using Table Extension and Page Extension.

In this article, we will Publish this extension to see what we have done in the application.


First, I will group my objects in folders so it's easy to maintain it in Source Control.

Right click and create new folders. Create Folders for Each object Type and select files & move to respective folders as shown below.



Now it looks more organized. Lets now try to publish our extension and then we will continue adding building our extension to meet customer requirements.

Now to Publish Extension - Using Keyboard Press F5.

There can be two kinds of Errors - 

1. The request for path /DynamicsNAV130/dev/metadata failed with code InternalServerError.
To Solve this refer to this article.

2. Could not publish the package to the server. See Visual Studio Code debug console for more details.

When we open Event Log, we get this details - The runtime is set to '2.1'. It must be set to '2.0'.


Open App.Json in Extension and change "runtime" parameter to 2.0 as shown below. Additionally, you can add details about your extension if you want but the only mandatory change is in Line 22 "runtime".


I have added following additional details - 

  • publisher - Who owns the Extension.
  • brief - Summary of extension.
  • description - Details of the Extension what it is and what it does.
  • URL - URL of your / company website.
  • logo  - If you want to specify a logo file in the Extension Window.
  • runtime - To 2.0 as per error message.

** NEVER EVER change the ID of an extension. It's a unique GUID for your extension generated by the system. So don't even touch it.

Now let's try to Publish Extension - Using Keyboard Press F5. The Output and Debug Console should like as below.

Output -


Debug Console -


The system will auto start the debugger, stop the debugger using Top ribbon.


In your VS Code, you will see a new file added ".app" as shown below.


Let's see in Business Central client, and see our Application.

Using the Tell me Icon, as shown below search for Source of Sales and here is what you will see.



Point to Note - Its categories as List and available in menu due to Usage Category that we defined during developing that page.

Let's see the standard Pages where we added fields "Source of Sales". It will look like as below.



Last thing that I want to showcase in this blog. Using Tell me feature search for the page "Extension Managment" and open it.



You will find all details about the extension from this page (as shown above). All the details in app.json are available on this page.

Hope you were able to publish your extension after reading this article. In the future, we will talk and understand the process of adding code in the same extension to complete the customer requirement.

Stay tuned and let me know your views as the comment to this article.

Regards,
Saurav Dhyani
https://saurav-nav.blogspot.com

2 comments:

  1. Hello sir, I have an issue while publishing an extension.
    "Reason: Your program license does not allow you to publish".

    I uploaded business central developer license, restarted server and tried again but no luck. Can you guide me on where it went wrong while publishing? Do I need to be in appsource or docker to publish?

    ReplyDelete
    Replies
    1. Hi,
      First check from Client that licensce is updated or not. You should try to Save licensce in database instead of uploading lic. in database.

      Delete