The article mentions creating a .DLL file, unfortunately, Dynamics 365 Business Central ditches the .NET Framework, in favor of stability. So I believed, an Add in would be impossible to be made for Dynamics 365 Business Central.
Thanks God, I was wrong. There’s official, though incomplete, documentation of how Add in survived into Dynamics 365 Business Central in here. And fortunately, many of Dynamics NAV technical peers have been giving guidance of how to utilize it. It’s great news, thanks to Kauffman here, and Vjeko, also has an older article in here along with his excellent video here. So I have all my learning materials.
Reviving the Old Web Page Viewer
Web Page Viewer add ins first introduced into Dynamics NAV 2017. Its existence was simple: to help showing a website inside the Dynamics NAV.
What unfortunate is, this extension doesn’t survive to Dynamics 365 Business Central. It’s simply gone. Due to my need of showing external site into my tenant, I need to revive it again from the dead – or build from scratch if I have to.
The WebPageViewer add in’s folder is still intact inside the Dynamics 365 Business Central on-premise, but I can assure you it’s NOT there in subscribe version.
First, I need to build the extension components that I know how to: the Control Add-in and the pages. Then to simplify things, I use a setup table to store which site you want to show, and I decide to show it up under Customer Card as a proof concept it works. My extension hierarchy is show as below.
I was able to copy paste the required WebPageViewer.js along with WebPageViewerHelper.js, but figuring out what the StartupScript should be, it’s another problem. The original WebPageViewer doesn’t provide any clue of it. I tried to mimic the WebPageViewer.dll, but still, how to show the website was unclear.
So instead, I took a script that just showed a page using jQuery and slapped start.js with it. I supposed to includes all of those events and procedures inside the start.js, but my main concern was to get this up and running before doing anything more complex.
And, voila, it works! Though until this point still I have no clue about the Callback.html and Loader.gif. But I guess it will serve it purpose someday. The result is show as below.
Thank God that Web Page Viewer is not totally dead. My revival process, though a bit crude, was succeeded.
You can always find the code in here. Feel free to comment about this.