ArcherPoint Dynamics NAV Developer Digest – vol 88
The ArcherPoint technical staff—made up of developers, project managers, and consultants – is constantly communicating internally, with the goal of sharing helpful information with one another.
As they run into issues and questions, find the answers, and make new discoveries, they post them companywide on Yammer for everyone’s 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 group—so we thought, wouldn’t it be great to share them with the rest of the Microsoft Dynamics NAV Community? So, the ArcherPoint Microsoft Dynamics NAV Developer Digest was born. Each week, we present a collection of thoughts and findings from the ArcherPoint staff. We hope these insights will benefit you, too.
Question on killing idle sessions:
Question: I have a user on a Dynamics NAV 2009 R2 DB wanting to auto kill sessions. I found a way to do this here:
This does not look too difficult to set up, but I was wondering if anyone has done this before and had any issues before I start.
Matt Traxinger: We've done it many times with no issues that I've ever heard of (minus standard Job Queue issues). Keep in mind they have to have an available NAS, and the time it takes to set that up if it is not already. Also, if they are planning on upgrading any time soon this is a standard feature from 2013 and up. There are also some add-ons that do the same thing, but I don't know costs.
Kollette Taylor: I have done this through a SQL Server Agent job. It was pretty quick and easy to do.
Jon Long: Be aware that deleting a session from the session table does not actually kill the session. However, it does free up a seat. So, this is an unintended "feature", a hack actually, that we can use, but probably shouldn't be built into a production database for client use. I use it if all seats are taken, and I need to log in and do something. To actually "kill" a session, effectively kicking a user off in addition to deleting the session record, you also need to call this in code:
Kyle Hardin: NAV 2009R2 actually kills the SQL session too, if you delete the NAV session. The feature than Jon mentioned didn't start until 2013. That having been said, the SQL Agent suggestion that Kollette mentioned will work regardless the version of NAV since you are killing it from the back end. In NAV 2013R2 and 2015, you have an idle timeout setting on the NST.
Tim Muldoon: On NAV2013, does the SQL Server Agent allow to kick users off after a specific amount of inactivity? And could the amount be assigned to each user? So that one user may get logged off after 30 minutes of inactivity while another won’t be logged off until say 60 minutes of inactivity?
Jon Long: You wouldn't use SQL Server Agent for this. To pull this off, you would create multiple NAV services. Then assign users to specific services. You can set the timeout times in the specific config files for each service.
Kyle Hardin offers this Development tip:
2016 now has a FOREACH statement that can be used against .Net collections. Very, very cool.
FOREACH FoundXmlNode IN FoundXmlNodeList DO BEGIN TempValue := FoundXmlNode.Attributes.ItemOf('name').Value; IF FORMAT(TempValue) = FORMAT(OptionName) THEN EXIT(FoundXmlNode.InnerText); END;
Karen Wingard shared a link on cXML:
Prospects and Customers have been asking about support for cXML as an e-commerce option. cXML (Commerce XML) is a subset of XML specifically intended for communication of business documents between procurement applications, e-commerce hubs, and suppliers. It touts having standardized schemas for ease of integration. Clarity Ventures, an e-commerce service company, offers an excellent introduction to cXML for eCommerce.
Editor’s note: There is also a comprehensive cXML user’s guide available from cXML.org here:
If you are interested in NAV development, check out our collection of NAV Development Blogs.
For step-by-step instructions on how to perform specific tasks in Microsoft Dynamics NAV, see our collection of How-To blogs.
If you found this post useful, you might also be interested to read through our archive of the Dynamics NAV Developer Digest.