Control Add-in in Business Central Windows APP. How to debug?
Hello everyone,
I have a control add-in which works perfectly in all browsers but does not response in the Business Central Windows App. Is there any way to debug the Windows App? I have some buttons. As soon as I press them the application freezes for 5 seconds and nothing happens. Regardless of which button is pressed.
I think it's a javascript error, but I'm not able to open up a console like in the browsers.
Below the javascript code. The buttons are highlighted.
function init(y, Width, Height) { if (y) { document.getElementById("controlAddIn").innerHTML = '
' + ' ' + '';' + '
' + '' + ' ' + '' + '<img src="data:image/png;base64, ' + y + ' />' + ' ' + '} else { document.getElementById("controlAddIn").innerHTML = ' ' + '<style>table {border: 1.5px solid #4cccd5;}' + ' input[type=button], input[type=submit], input[type=reset] { ' + ' background-color: #4cccd5; ' + ' border: none; ' + ' color: white; ' + ' padding: 16px 32px; ' + ' text-decoration: none; ' + ' margin: 4px 2px; ' + ' cursor: pointer; ' + ' } ' + '</style> ' + ' <table cellpadding="0" width="' + Width + '"> ' + ' <tr> ' + ' <td height="' + Height + '" width="' + Width + '"> ' + ' <canvas id="cnv" name77="cnv" width="' + Width + '" height="100"></canvas> ' + ' </td> ' + ' </tr> ' + ' </table> ' + ' <canvas name="SigImg" id="SigImg" width="500" height="100"></canvas> ' + **'<button id="signbutton" onclick="javascript:onSign(' + Width + ',' + Height + ')">Sign</button>' + '<button id="clearbutton" onclick="javascript:onClear()">Clear</button>' + '<button id="donebutton" onclick="javascript:onDone(' + Width + ',' + Height + ')">Done</button>'** }} var tmr; function onSign(Width, Height) { var ctx = document.getElementById('cnv').getContext('2d'); SetDisplayXSize(Width); SetDisplayYSize(Height); SetTabletState(0, tmr); SetJustifyMode(0); ClearTablet(); if (tmr == null) { tmr = SetTabletState(1, ctx, 50); } else { SetTabletState(0, tmr); tmr = null; tmr = SetTabletState(1, ctx, 50); } }
function onClear() { ClearTablet(); }
function onDone(Width, Height) { if (NumberOfTabletPoints() == 0) { } else { SetTabletState(0, tmr); SetSigCompressionMode(1); SetImageXSize(Width); SetImageYSize(Height); SetImagePenWidth(5); GetSigImageB64(SigImageCallback); } }
function SigImageCallback(str) { Microsoft.Dynamics.NAV.InvokeExtensibilityMethod("GetSig", [str]); }
Here's the reply from the owning team: UWP apps don't support debugging when they are installed from the store. To investigate JS issue one needs to thoughtfully reason about the code and add exception handling which then can show UI message to the user and provide enough context for root cause investigation.
Hello. Your information is not very accurate. I was able to debug the Javascript with Visual Studio debugger.
best regards, Thomas Barbut