ArcherPoint Dynamics NAV Business Central Developer Digest - vol 342 Suzanne Scanlan Fri, 04/30/2021 - 05:45

ArcherPoint Dynamics NAV / Business Central Developer Digest - Vol 342

Report issues, comparing versions using PowerShell, documenting code changes with an extension, and adding keys in BC discussed in this Developer Digest.

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...so everyone can 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 this great information with everyone who might not have the time to check out the multitude of resources out there? So, the ArcherPoint Microsoft Dynamics NAV 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.

A New Way of Creating Permissions

The MyNAVBlog site recently shared a “new” way of doing permissions. When developing Extensions, you need to set permissions, something all developers dislike. But with the latest (BC 18) release of Business Central 2021 Wave 1, there is another option. Read I Never Want to Go Back to XML Permissions for more information.

Report Issue with Business Central 16: No Results Displaying in Layout

Tom H has a problem: “I am having the weirdest issue with a report in BC 16. I run the report, and I can't get any results to show in my layout, except for one record. Here's the crazy part: I can get a dataset out, but the layout doesn't display anything. I even tried creating a custom layout that was just a table with a few of the fields, and that still gave me the same result. Has anyone seen anything like this? Does anyone have anything I could try? My sanity is quickly slipping.”

Kyle asks: “Does it do the same thing in your local Docker container?”

Tom replies: “It does not do the same thing in my local Docker container. It's the weirdest thing.”

Denise wants to know: “Can you send the data to a table to see if you are at least getting that far? Then maybe print from that table if that works?”

Tom responds: “It's a document report, so it touches a lot of tables. I might wind up needing to do something, but the issue is intermittent. It works for some documents but not others. Also weird: I've used RapidStart to (mostly) get the data from the customer's DB and load it on my local container. Even using a dataset that's virtually identical, the local container version works but the remote version does not.”

Tom later adds: “I eventually resolved this by copying/pasting the problem report into an entirely new object. I have no idea why that worked, but I have no idea why the problem happened in the first place, either. I'll let Alex at Hoskin take credit for that idea, since it worked after about 24 other things failed.”

Comparing Two Versions of Dynamics and Getting a Max Version Using PowerShell

Saurav asks: “How do you compare two versions and get a max version using PowerShell?”


Figure 1 – Comparing two versions in PowerShell

Suresh responds: “You can just use Version object and compare, like this:

[version]'1.0.0.1' -gt [version]'1.0.0.2' 

Documenting Your Code Changes with an Extension 

Suresh advises: “Try the CodeTour extension if you want to document your code changes: 

The Caveat to Adding Keys in Business Central 

Saurav says: “Don't get super excited with adding keys in Microsoft Dynamics 365 Business Central. We can add a key with all base table fields and all new fields but cannot add a key with combination of base field and custom field.” 


Figure 2 – Adding Keys in Microsoft Dynamics Business Central

Kyle sympathizes: “Slight frown” 

Matt T weighs in: “Meh, should have been expected and makes perfect sense. I don't exactly know what they're doing on the back end, but I'm pretty sure you can only add an index to a view that joins the tables. My guess is they are being a bit more prescriptive about it and doing much more complicated joins every time for performance reasons.”

If you are interested in Dynamics NAV and Business Central development, be sure to see our collection of NAV/BC Development Blogs.

Read the "How To" blogs from ArcherPoint for practical advice on using Microsoft Dynamics NAV and Dynamics 365 Business Central.