Dynamics Business Central / NAV Development Developer Digest - Vol. 414
ArcherPoint’s Developer Digest focuses on Microsoft Dynamics 365 Business Central and Dynamics NAV development. In Developer Digest Volume 414, we explore symbols in a hybrid environment, debugger issues, and token acquisition in BC SaaS.
The Dynamics NAV and Business Central community, including the ArcherPoint technical staff, is made up of developers, project managers, and consultants who are constantly communicating, with the common goal of sharing helpful information with one another to help customers be more successful.
As they run into issues and questions, find the answers, and make new discoveries, they post them on blogs, forums, social media…for everyone’s benefit. We in Marketing watch these interactions and never cease to be amazed by the creativity, dedication, and brainpower we’re so fortunate to have in this community—so we thought, wouldn’t it be great to share the wealth of information with everyone who might not have the time to check out the multitude of resources out there?
Thus, the ArcherPoint Microsoft Dynamics NAV/BC Developer Digest was born. Each week, we present a collection of thoughts and findings from NAV/BC experts and devotees around the world. We hope these insights will benefit you, too.
Developer Tip of the Day: Symbols in a Hybrid Business Central Environment
Kyle: “I have the misfortune of having to work in a BC14 hybrid environment where part of the code is C/AL and part is AL. I have figured out how to generate and download symbols using a Docker container (rather than the customer’s server).
Build your BC14 Docker container. Import a giant FOB of the C/AL customizations. Then edit the docker container’s service tier customsettings.config file and make sure this setting is True:
Reboot the docker container. Then download symbols from Visual Studio Code. The FOB symbols will be contained in either the Application or System app files in the .alpackages folder of your VSC project.
Unrelated: Please upgrade. C/AL sucks.”
Debugger Crashes Reported
Daniel Rimmelzwaan puts out a call on Twitter for #bcalhelp when debugging expanding the Globals shut down the debugger altogether. Natalie Karolak shares a reported issue, Debugger Crashes: Please Improve Exception Handling and Error Message Handling, to which we are awaiting a fix, expected in January. Daniel is experiencing a similar but different issue, so he too has submitted a ticket for the Debugger Stops When Expanding Globals.
Business Central SaaS: Not Returning Token nor Error
Tin Fister also reached out to the Twitterverse for #bcalhelp, noting that AcquireTokenAndTokenCacheByAuthorizationCode would not return a token, but also would not return any error message in BC SaaS. However, the code works in an on-premises environment. He asks if anyone else has had the same problem and how to resolve it.
Arend-Jan needs clarification: “Single tenant or multitenant app registration?”
Tin: “Multitenant. I’ve registered my app in Azure Active Directory Applications even if the app is not written in BC. I get an error when a popup is blocked, but I don’t get an error when the token is not fetched. Can’t tell what’s wrong or debug that system function.”
Arend-Jan then asks: “Did you remember to change the redirect URL to BC SaaS? If it works on-prem, then you were using a different redirect URL.”
Tin: “I’m using the built-in function to get redirect URL which I’m using: OAuth2.GetDefaultRedirectURL(RedirectURL); I now see that is was wrongly set up in my Azure app registration under mobile & desktop apps, not under WEB. Now it works.”
Tin continues: “I would expect that AcquireTokenAndTokenCacheByAuthorizationCode gives an error when the token is not acquired – that could maybe help with debugging the problem
Arend-Jan agrees: “I agree. The error handling could definitely be improved. In this case, I’m sure Azure replied with an error message about not expecting a secret for a public redirect URL.
Ramiz offers: “Try using the function AcquireTokenWithClientCredentials.”
Killian requests: “Maybe you should ask the same question on Yammer where it’s easier to provide some more details with some code examples. I checked the impl. Codeunit and did only see differences for the redirect URL.”
Interested in Dynamics NAV and/or Business Central development? Be sure to see our collection of NAV/BC Development Blogs.
Read “How To” blogs from ArcherPoint for practical advice on using Microsoft Dynamics NAV and Dynamics 365 Business Central.