This post is based entirely on the blog from Roberto Stefanetti so if you wish to learn further about widgets and the possibilities of ControlAddins make sure to check it out:

Recently it seems like everyone holds some sort of cryptocurrency and you never know if someone might want to track Bitcoin, Ethereum or even Dogecoin within their system. Business Central can let us know via widgets any crypto’s price and graph that we setup. The widget will be shown on the role center to consult at any time.

This can be done thanks to ControlAddins and JQuery.

For this purpose we will need two ‘.js’ files and one ‘.al’ file.

In this ‘.js’ file you can setup any crypto you might want to track. You can also change the size and color of the widget:

new TradingView.MediumWidget(
    "symbols": [
    "chartOnly": false,
    "width": '100%',
    "height": 300,
    "locale": "en",
    "colorTheme": "light",
    "gridLineColor": "#F0F3FA",
    "trendLineColor": "#2196F3",
    "fontColor": "#787B86",
    "underLineColor": "#E3F2FD",
    "isTransparent": false,
    "autosize": true,
    "container_id": "tradingview_460f8",

Then you will need the container of JavaScript:

const controlAddIn = $('#controlAddIn');

$("#controlAddIn").html( `
  <div class="tradingview-widget-container row">
    <div id="tradingview_460f8"></div>
    <div class="tradingview-widget-copyright"><a href="" rel="noopener" target="_blank"><span class="blue-text">Bitcoin</span></a> by TradingView</div>

Finally, the ControlAddin, the’.al’ file that will tell Business Central how to build and shape our widget. TradingView will be the site that provides the information about the cryptocurrencies.

You can learn further about Control Addins in

controladdin "CryptosAddin"
    RequestedHeight = 300;
    MinimumHeight = 300;
    MaximumHeight = 300;
    RequestedWidth = 700;
    MinimumWidth = 400;
    MaximumWidth = 700;
    VerticalStretch = true;
    VerticalShrink = true;
    HorizontalStretch = true;
    HorizontalShrink = true;
    StartupScript = 'src\controladdin\CryptosAddin\js\main.js';

    // SCRIPT Plugin
    Scripts =
            '',// jquery  

    StyleSheets = '',// bootstrap                      
                    '';// fontawesome

    event controlAddinReady()

The structure of files should look like this:

Finally we will embed the ControlAddin in the Role Center by extending the Business Manager Role Center:

pageextension 50101 "BusinessManagerExt" extends "Business Manager Role Center"
{    layout
            part(Cryptos; Cryptos)
                ApplicationArea = All;

In the Role Center will appear the widget we have built and we can also interact with it, change periodicity and, of course, see the other cryptos data:

Hope you find it useful.

How To Show Bitcoin Price in Business Central?

Post navigation

Leave a Reply

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