ArcherPoint Dynamics NAV / Business Central Developer Digest - Vol 299
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.
Microsoft Business Central v16 and the Get-NAVServerSession Command
Kyle asks: “The PowerShell command, Get-NAVServerSession, returns a list of connected users. It looks like the list is of the connections to the database, not the connections for that particular service tier. Is there a way to get a list of users for a service tier? I'm trying to troubleshoot a load balancer, but I can't tell which service tier a user connects to.”
Jon responds with this article: “Microsoft says Get-NAVServerSession returns the UserID and Service Tier name.”
Developer Tip of the Day: Page Fields and Style Properties
Kyle shares his infamous Developer Tip of the Day: “Page fields and the Style and StyleExpr properties: I know all of you are missing the days when Forms could be retina-burning abominations of color - see the image below as an example. But sometimes you just want to turn the contents of a field a certain color to indicate something useful, like being past due or needing an action. Style and StyleExpr let you do that. Style can be set to several canned values documented in the link above; they cannot be expanded on, and there is no way to set a specific RGB color like we used to be able to do. Set the Style property on a field, and then set the StyleExpr property to be a Boolean with whatever logic behind it you want:”
field("Document No."; "Document No.")
StyleExpr = (Status = Status::Changed);
Style = Attention;
Figure 1 – Using the Style and StyleExpr properties to highlight fields in Microsoft Dynamics Business Central
Gwendolynn laments: “The horror, the horror.”
Mark G answers: “Every developer over their career has seen a screen like this at least once. Surprising how similar they all look across various customers and how beloved by the user they all are.”
Denise reacts: “Those were fun times!”
Tim L. responds: “There's a time and place for colorizing. I used to color code A/R forms one color, A/P another, so you could tell without looking whether you're in one or the other. Frankly, I still need to double check where I'm at, as all the pages look a little too consistent.”
Saurav adds: “That screenshot is real. And I have made mistakes like this in past.”
Microsoft Standard Tests for Dynamics 365 Business Central Base Code
Bill W. shares: “The Microsoft Standard Tests have all sorts of great examples of how they test base Business Central code. The screenshot below shows code I found and adopted to test an XmlPort CSV export. Having a test to verify position and content is way easier (IMO) than trying to visually count and match the output.
Figure 2 – Code Adopted to Test an XML CSV Output from Microsoft Business Central
When did they add the CSV Buffer??”
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.