Business Central AI Demos and Hands-ons
Those of you who know me, know that a big part of what I do is delivering talks at conferences. Talks, workshops, demos, that kind of stuff. More often than…
Those of you who know me, know that a big part of what I do is delivering talks at conferences. Talks, workshops, demos, that kind of stuff. More often than…
This post has been long overdue. I’ve had it in my to-do list for nearly four years now, but it always ended up in the not today category. Funny how many times I’ve implemented it already, and how many times I’ve presented this, and I never ever found a few minutes to create a demo repository and a blog to come with it. So, here we go.
Including web fonts in your control add-ins is no rocket science, really. Control add-ins are just pieces of HTML, CSS, and JavaScript running in an iframe, so whatever you can do within an iframe from anywhere else, you can do it from control add-ins. Web fonts are no different. The problems start if you want to package web fonts into the control add-in so that you can use them even when your BC/NAV instance is running in an isolated network, or if you simply want to eliminate any external dependencies.
Control add-ins support packaging script, stylesheet, and image files. This could make you think that you cannot include web fonts. But that would be wrong. If you read my blog post about abusing images to load HTML files, then it might give you some ideas. Yes, you can use the same trick to load web fonts or just about any other external resource.
Let’s take a look how to include a web font, and let’s use Font Awesome as an example. Because it’s just awesome.
Out-of-the-box Business Central APIs often use complex types. Addresses on entities and documents, line details, units of measures, journal dimensions, these are just a few examples. There may be more. A typical instance of a complex type looks like this:
The question is: can you do something like this in your own custom APIs?
And the answer is: yes and no.
Let’s start with the “yes” part of the answer.
Just in case you have fallen victim of the confusion I see often in online communities, blogs, but also Microsoft official documentation: Dynamics 365 Business Central sandbox is not the same as Dynamics 365 Business Central preview. They are two different things. Keep in mind, in this blog post I am not talking about sandbox container environments (on-prem); I am only talking about online sandbox environments.
This is not pure semantics. Things in sandbox environments (and I mean, real sandbox environments of Business Central) differ from things in preview environments.
In just under two weeks I’ll have to present how to use OAuth 2.0 authentication to call REST APIs of Dynamics 365 Business Central. Should be easy. Not only I have already done
OAuth integrations, but there is also a nice step-by-step tutorial by Microsoft specifically done for Business Central. So, I followed the steps to the letter (as much as that was possible), and after all was done, I tried to use Postman to get myself an OAuth 2.0 token for invoking Business Central REST APIs, but it didn’t work. No matter what I did, Postman kept returning this:
(Could not complete OAuth 2.0 login. Check Postman Console for more details.)
So I checked the Postman Console for more details.
(access_denied; Error)
Quite some detail.
After a ridiculous amount of time troubleshooting this, I figured it out. Depending on how your Business Central trial account was configured you may encounter this problem. On top of it add the fact that the documentation isn’t exactly straightforward and at couple of places leaves you (educated-)guessing. So I decided to write this blog in case you (or myself at some future point after I will have forgotten I’ve been in this mess) ever need it.