ArcherPoint Dynamics NAV Developer Digest - vol 291

ArcherPoint Dynamics NAV Developer Digest - vol 291

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.

Single-Instance Codeunits are Still “Cool”

Kyle shares his “Developer Tip of the Day: Single instance codeunits are still sometimes cool: If you have an event subscriber codeunit subscribed to several events (various field validations, for example), the codeunit will get instantiated and destroyed for each event call. Sometimes, you don’t want that to happen. We found a bug in Table 37 (BC15.CU0) where Dimension 1 gets overwritten by whatever is on the header. even if it is already set on the line. So, we made our subscriber codeunit be SingleInstance, stashed the dimension into a global variable in OnBeforeValidate, and then set the line to that (correct) value in OnAfterValidate.” 

Gwen retorts: “Show off.” 

Tim L asks: “So, what happens when that bug is fixed?” 

Kyle responds: “In this specific example, my fix will still work, since I override whatever the base code is doing to preserve my dimension value. But in general, this is why upgrades will continue to be an interesting challenge. I am going through the exercise of applying a cumulative update for a client, and I’m having to go through all of the base objects that we copied to custom objects and “upgrade” each of them. There is still a manual step that requires you to decide whether a customization is still needed.” 

Applying Business Central Cumulative Updates 

Kyle: “When applying a BC cumulative update, there is a step where I am supposed to do this: 

Invoke-NAVApplicationDatabaseConversion  

Does that PowerShell run all of the Upgrade codeunits that come with the Base application in the cumulative update?” 

Saurav replies: “No. Invoke-NAVApplicationDatabaseConversion is equivalent to when you open a NAV database with higher executables (database in NAV 2018 CU0 – open in NAV 2018 CU5) and the system does a conversion. Upgrade codeunits will only execute when you use PowerShell  cmdlet Start-NAVDataUpgrade. 

Giving Access to Source Code to a Customer in AL

Kyle poses a hypothetical: “A customer is completely AL…it doesn’t matter whether they are cloud or on premises. And that hypothetical customer requests access to the source code, much like the old Object Designer would let a customer see code in objects. How do we do that in the AL world?” 

Matt T responds: “Extension Management, find the extension, click Manage, then Download Source.” 

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.

Trending Posts

Stay Informed

Choose Your Preferences
First Name
*required
Last Name
*required
Email
*required
Subscription Options
Your Privacy is Guaranteed