ArcherPoint Dynamics NAV Developer Digest - vol 148![Developer Dude]()
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.
Using AutoIncrement for a Table Field in Dynamics NAV
Kyle asks, “Do any of you use the AutoIncrement property for a table field? Discuss.”
Chris M. answers, “I've used it before for the last field in the primary key of a non-ledger table. Although you probably could use it for ledgers, I don't.”
Bill W. chimes in, “Yes, when you just want to throw data in a table and not worry about that running value. For a staging table this can be much faster. It can be problematic if it is the primary key, and you want to update the record, you do not have its value before you insert so you have to retrieve the record. You might as well just use the standard FINDLAST/EntryNo routine. You also have to be careful because you cannot include or modify it without special SQL permissions. Deleting everything in the table also does not reset it to zero; you have to use a SQL command to reseed the table.
Stock code uses it in places. Dimension Value's ‘Dimension Value ID’."
Chris M. responds, “Correct on the update issue. Because of that, I use it for records that are used in a lookup table, where I don't need to search for a specific record, I just need to let the user add records and then choose one later.”
Michael H. says, “I've been using AutoIncrement for years for all my staging tables because I don't like NAV's method of LockEntireTable-FindLastRecord-IncrementEntryNo-Insert. I think this could be detrimental in a high volume table. I have never experienced locking issues; I do not have any trouble with updates, and the solution scales extremely well. Full disclosure, though, the upgrade team encountered an issue in that two of the staging tables had the EntryNo RENUMBERED on every record. First time I have seen that happen and I hope the cause is discovered. Thankfully, the EntryNo in these two tables wasn't referenced anywhere.”
The Best Compiler Warning Ever
Bill Warnke exclaims, “‘Warning AL0374: The use of a unique id has been deprecated and the id can be removed.’
Best compiler warning ever! I see this message compiling a 2018 project with this update. However, it does not yet appear to be fully implemented. Imagine that world where you don't have to worry about an object id.”
Jon Long replies, “Temp Table Best Practice Tip: temp tables do not get counted in the licensed tables. In other words, you can create a table 80000 that is outside the customer license and use it anywhere you want. So, best practice is to create all temp tables outside the clients licensed range.”
Leadership Lines
The Dark Side of Working from Home, an article by Frank Chung, explores the possibility that working from home may not be so great after all. Hmmm, I have to disagree, although I do have a separate room in my house where I work from, and I stick to regular working hours. For all you remote workers, what do you do to keep your work and personal lives balanced? Your comments are welcome!
Stay abreast of what is new in the Microsoft Dynamics NAV community and at ArcherPoint by subscribing to our monthly newsletter, Better Business, by completing the form in our Resource Center.
And, if you are interested in NAV development, be sure to see our collection of NAV Development Blogs.