ArcherPoint Dynamics NAV / Business Central Developer Digest - Vol 292
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.
Factbox Uses in Microsoft Dynamics NAV
Leanne asks: “Hi Developers! I have a customer requesting a Factbox on the Sales Order page for reading/editing Sales Line Comments. Has anyone done something like this before? NAV 2015 is the version.”
Kyle responds: “There is already a working Factbox for the lines, called Sales Line Detail. You should be able to take that apart to see how the page/subpage/Factbox updating logic works. Steal that so you are updating when they select a line, and make sure you are showing the correct line comment.”
Matt T notes: “Factboxes really aren't supposed to be used to edit data. Their size makes them really bad for data entry.”
Leanne responds: “I was concerned about the editing part. I'll talk to them about it.”
Matt S adds: “They are, however, good for hyperlinking to a page where you can edit the data.”
Leanne responds: “Thanks! That's a good alternative.”
Renaming Files to Adhere to New AL Naming Convention
Kyle ponders: “Suppose I want (even though I don't) to rename files to adhere to the new naming convention for AL. Am I supposed to preface all of the filenames with ARC? ARCAgedAccountsPayable.Report.al?”
Matt T replies: “Technically, yes. I think this is the third change to file naming standards from Microsoft.”
Bill W suggests: “If you hover over the warning underline in the object, it will tell you the ‘proper’ name. With or without the prefix/suffix seems to be acceptable.”
Kyle asks: “What about the ‘internal’ object names - the ones at the top of AL itself?”
Bill W adds: “It looks like they've updated the best practices for AL. If you hop your extension up to v5.0, it should detect the file name and give you the suggested fix.”
Developer Tip of the Day: AL Reports Pointing to RDL Layouts
Kyle offers: “Developer Tip of the Day: Do not have two AL reports pointing at the same RDL layout in an AL solution. It will confuse the dataset injection logic and cause very strange behaviors. You won't see them as compile errors, but it can cause nasty problems in a customer service tier. This morning, in a live customer system, the customer could not run any reports. Didn't matter the report, didn't matter if it was a print preview, generating a PDF, or trying to actually print to a printer. No reports would run, and the user would simply get a message in the web client, ‘An error has occurred’, which is what BC does when it isn't happy with report layouts. Once I solved the underlying report RDLC problem, everything started working again.”
Essential VS Code Extensions
Bill W shares: “These are the VS Code extensions I use daily. Which ones do you find essential?
- Tab brings you out of  or () so you don't have to arrow or mouse out of them: https://marketplace.visualstudio.com/items?itemName=albert.TabOut
- There are times you need to restart VS Code. Use Reload to do this and be right back where you were: https://marketplace.visualstudio.com/items?itemName=natqe.reload
- Run PowerShell right from a terminal window: https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell
- Stop/Start/Restart your Docker Containers: https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker
- Colorize bracket pairs for better code readability: https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer-2
Other handy extensions:
- Take a picture of your code: https://marketplace.visualstudio.com/items?itemName=adpyke.codesnap
- Generate a new guide for an AL app: https://marketplace.visualstudio.com/items?itemName=heaths.vscode-guid
Len shares his…
- Object Designer: Great way to search for and view the base BC apps. Search is not case sensitive and doesn't require asterisks around search criteria. The new version doesn't store "alcache" and "altemplates" like it used to so it's cleaner: https://marketplace.visualstudio.com/items?itemName=martonsagi.al-object-designer
- Azure Repos: I just started using this. It works for a quick way to create and commit to a branch from within VS Code: https://marketplace.visualstudio.com/items?itemName=ms-vsts.team
- SQL Server: Great way to browse through your SQL databases, even in containers: https://marketplace.visualstudio.com/items?itemName=ms-mssql.mssql
Len continues: “Docker and PowerShell are awesome as well! But I have to try some of those others…like Tab looks cool.”
Kyle adds: “GitLens. But that's the only one I use. I only do PowerShell from an elevated PowerShell prompt. I went to install the bracket colorizer 2, and it said it was already globally enabled—maybe that is an integral feature in the latest VSC build, because I never installed it.”
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.