<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dynamics NAV Integration &#187; troubleshooting</title>
	<atom:link href="http://www.dynamicsnavintegration.dk/tag/troubleshooting/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dynamicsnavintegration.dk</link>
	<description>A site about Dynamics NAV Integration and development</description>
	<lastBuildDate>Wed, 16 Dec 2009 22:08:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Logging Code Coverage to file in Dynamics NAV</title>
		<link>http://www.dynamicsnavintegration.dk/logging-code-coverage-to-file-in-dynamics-nav/</link>
		<comments>http://www.dynamicsnavintegration.dk/logging-code-coverage-to-file-in-dynamics-nav/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 23:35:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[code coverage]]></category>
		<category><![CDATA[dynamics nav development]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://www.dynamicsnavintegration.dk/?p=11</guid>
		<description><![CDATA[This entry will be about the CODECOVERAGE feature of Dynamics NAV.
This is done in version 5.0 SP1 but works in most newer versions.
I will not cover the normal use of Code Coverage. And by normal use I mean the scenario where you (the dynamics nav developer) manually start and stop the Code Coverage and view [...]]]></description>
			<content:encoded><![CDATA[<p>This entry will be about the CODECOVERAGE feature of Dynamics NAV.<br />
This is done in version 5.0 SP1 but works in most newer versions.</p>
<p>I will not cover the normal use of Code Coverage. And by normal use I mean the scenario where you (the dynamics nav developer) manually start and stop the Code Coverage and view the code. I am sure most of you know how to handle that.</p>
<p>I recently found an new feature which I hadn&#8217;t really thought of before. And it became very useful indeed.</p>
<ol>
<li>The option to start Dynamics NAV with CODECOVERAGE enabled.</li>
<li>The option to tell Dynamics NAV to log all CODECOVERAGE to a file.</li>
<li>The option to start and stop the CODECOVERAGE from code.</li>
</ol>
<p>In a problem solving situation where you cannot reproduce an error presented to you by a user, the combination of features 2 and 3 turned out to be a great tool.<br />
Why?<br />
Because it gives me the precise code that was executed at the time the error occured at the user&#8217;s computer, and I didn&#8217;t even have to be present.<br />
He can send me the log file, and I can open it in my own Dynamics NAV client (which is also done using option 2 above).</p>
<p><strong>Here is what you do:</strong></p>
<p>1. Change the user&#8217;s shortcut, so that the client will always log CODECOVERAGE to file, when started. This is done by adding:</p>
<blockquote><p>COVERAGEFILENAME=c:\somefilename.txt</p></blockquote>
<p>&#8230;to your program shortcut.<br />
Like this:</p>
<p style="text-align: center;"><img class="size-full wp-image-17   aligncenter" title="1-code-coverage-shourtcut" src="http://www.dynamicsnavintegration.dk/wp-content/uploads/1-code-coverage-shourtcut1.jpg" alt="1-code-coverage-shourtcut" width="455" height="489" /></p>
<p>Now the client knows that whenever CODECOVERAGE is started &#8211; manually or by code &#8211; it must log to that file.</p>
<p>If you suspect something weird is going on in&#8230;say&#8230; the Sales Order Form, you can start Code Coverage in OnInit trigger:</p>
<blockquote><p>CODECOVERAGELOG(TRUE);</p></blockquote>
<p>..and stop it in the Onclose trigger:</p>
<blockquote><p>CODECOVERAGELOG(FALSE);</p></blockquote>
<p>Always running the form with Code Coverage enabled like this will of course have some impact on the performance for that user, but when hunting a problem it can be very useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dynamicsnavintegration.dk/logging-code-coverage-to-file-in-dynamics-nav/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

