ArcherPoint Dynamics NAV Developer Digest - vol 203

ArcherPoint Dynamics NAV Developer Digest - vol 203

The NAV 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 experts and devotees around the world. We hope these insights will benefit you, too.

Dynamics NAV Cumulative Updates for July

Here are the CUs from Microsoft for July:

Thanks for posting, Pavithra.

Please Don’t Write Code Like This

Kyle makes a request, “Please do not ever write code like this. I found this in a live customer database (not written by us).”

IF Posted OR xRec.”Zero Gallon Delivery” THEN BEGIN

“Zero Gallon Delivery” := TRUE;

ERROR(‘You can not reverse Zero Gallon Delivery Setting once it it set’);

EXIT;

END;

Matt T comments, “You have to explain why it’s bad if you want people to learn why not to do it.”

Kyle adds, “Let’s start at the BEGIN.

“Zero Gallon Delivery” := TRUE;

This line will update the current record, and then promptly get rolled back by the ERROR.

ERROR (‘You cannot reverse Zero Gallon Delivery Setting once it is set’);

Always use a Text constant.

EXIT;

This line will never be executed because the ERROR causes a transaction rollback and termination of code execution for this object.”

Matt T responds, “Everyone starts somewhere with NAV Development. That’s why it’s important to explain when things are good and things are bad.”

Jon replies, “END;

This command will never be called and would not be needed had the BEGIN not……oh, never mind. Here:

IF Posted OR xRec.”Zero Gallon Delivery” THEN

ERROR(Text003);”

Bill W supplements the conversation, “I see two competing ways of solving the same problem and they never got around to picking one. Customer, ‘Can I see what it would look like with an error message real quick?’ Perhaps the original developer got pulled to another project and someone else just moved the code. With our chosen method of everyone develops in the same basket, we don’t have this issue. But, it is easy to imagine how it happened.

These days with the tools available to us, this would be on the organization that it came out of, not the developer (IMO). Everyone makes mistakes and this would be an easy one to pick out in a code review/pull request. As a learning and sharing organization, what better way to enforce our standards and push all of the great knowledge out to everyone than by looking at each other’s code?”

Using Libre Office Instead of Microsoft Office

Len is tasked with an unusual request, “I have a client who wants to use Libre Office instead of Microsoft Office so they want to know if there is a way to “Print to Libre Office” instead of “Print to Excel”. I know some time ago Microsoft used to have a way to setup different .exe files to send to. Does anybody know of something similar in NAV 2017 or NAV 2018?”

Matt T replies, “I’m not sure if this would still work as it is pretty old, and it’s a registry hack. You’d just replace the path (value data) with the path to the Libre Office executable.

See the Mibuso post, Use Open Office Instead of Microsoft Office.”

If you are interested in NAV development, be sure to see our collection of NAV Development Blogs.

Read the “How To” blogs from ArcherPoint for practical advice on using Microsoft Dynamics NAV, and contact ArcherPoint if you need assistance with Dynamics NAV.

Trending Posts

Stay Informed

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