<?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>Investigating DAX</title>
	<atom:link href="http://fedotenko.info/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://fedotenko.info</link>
	<description></description>
	<lastBuildDate>Wed, 10 Mar 2010 14:41:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>1</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Tracing in Dynamics AX 4 and 2009</title>
		<link>http://fedotenko.info/?p=164</link>
		<comments>http://fedotenko.info/?p=164#comments</comments>
		<pubDate>Wed, 10 Mar 2010 14:39:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Performance; Trace parser; DAX Kernel;Tracing;]]></category>

		<guid isPermaLink="false">http://fedotenko.info/?p=164</guid>
		<description><![CDATA[I’ve spent considerable time trying to figure out how tracing works in newer versions of Dynamics AX. Although manual for Trace Parsers seems to be quite satisfactory on topics related to analysis of collected trace, it is pretty terse on the topic of trace collection and setting up; Dynamics AX Performance Team log has two [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve spent considerable time trying to figure out how tracing works in newer versions of Dynamics AX. Although manual for Trace Parsers seems to be quite satisfactory on topics related to analysis of collected trace, it is pretty terse on the topic of trace collection and setting up; Dynamics AX Performance Team log has two very useful posts on trace parser (<a href="http://blogs.msdn.com/axperf/archive/2008/07/18/traceparser-video-training-part-i-installation.aspx">http://blogs.msdn.com/axperf/archive/2008/07/18/traceparser-video-training-part-i-installation.aspx</a> and <a title="http://blogs.msdn.com/axperf/archive/2008/07/30/traceparser-video-training-part-ii-configuration-collection-and-importing.aspx" href="http://blogs.msdn.com/axperf/archive/2008/07/30/traceparser-video-training-part-ii-configuration-collection-and-importing.aspx">http://blogs.msdn.com/axperf/archive/2008/07/30/traceparser-video-training-part-ii-configuration-collection-and-importing.aspx</a>), but it seems that these trainings cover some early beta of trace parser tool and prerelease version of DAX2009. So, I decided to write small article about my findings related to trace parsing in Dynamics AX.</p>
<p>To have a full picture of tracing subsystem in DAX, keep in mind that actually DAX supports THREE kind of tracing:</p>
<ol>
<li>SQL Tracing</li>
<li>Server Tracing</li>
<li>Client tracing</li>
</ol>
<h3>SQL Tracing</h3>
<p>This kind of tracing was supported from the earliest version of Axapta, I’ve met. Even in Axapta 2.1 it was possible to have a log of SQL Statements issued by your application, by checking appropriate checkboxes in SQL tab of user settings. I won’ describe these settings in detail, You’d better play with them to understand. I only want to mention two SQL tracing-related peculiarities, introduced in version 4.0:</p>
<ol>
<li>SQL Tracing work <strong>ONLY</strong> if your AOS configuration has “Allow client tracing on Application Server Instance” setting <strong>checked</strong>. In versions 2 and 3, SQL trace worked independent from any server configuration settings, so I was  little surprised when I tried to run familiar SQL trace on DAX4.0 without any results. It seems,that in attempt to gain couple of extra percents of performance, DAX kernel’s team decided to make this SQL tracing globally switchable starting from version 4.0.</li>
<li>If you are trying to log SQL Trace into file, expect to find this file ON SERVER SIDE. In versions 2 and 3, SQL trace file was being stored on local log directory. Starting from version 4.0, SQL trace file is being stored on Server side log directory. Probably, this is because performance team decided to completely decouple tracing process from client. Before attempt to commence SQL Tracing to file, please ensure that your AOS user (I mean – AD user, under which account AOS is run) has enough rights to create and write files in log directory. (Normally, It is something like C:\Program Files\Microsoft Dynamics AX\50\Server\DynamicsAx\Log).</li>
</ol>
<p>Also, Normally results of SQL Tracing is stored in SQL table, browsable from Axapta itself. The only reason for usage of SQL Tracing to log-file is a special request from Microsoft support team (because it is much easier to e-mail a log-file than log-table).</p>
<h3>Server tracing</h3>
<p>The most useful way of tracing to my experience. First of all, I want to mention that this tracing module was introduced in Dynamics AX 4.0 and it heavily depends on Events Tracing for Windows subsystem (described in details in <a href="http://msdn.microsoft.com/en-us/library/aa363787(VS.85).aspx">http://msdn.microsoft.com/en-us/library/aa363787(VS.85).aspx</a>) So, if You have some problems with starting server trace, You should check that your AOS Server has appropriate Trace Provider installed. You can do it by running “logman query providers” command in AOS’ command prompt. Resulting output must have a line starting with “AOS Trace”. If your server does not have appropriate query provider, You can try to fix this by going into server’s BIN directory and running ‘mofcomp aos_trace.mof’ command. If your server has UAC turned on, this command must be run from command prompt with elevated privileges.</p>
<p>Tracing parameters can be configured on the ‘Tracing’ tab of Dynamics AX server configuration utility. I won’t go into detail about every checkbox and number on this tab,coz they are described in reasonable details in trace parser’s manual. The most funny thing about server tracing is that important-looking ‘Start Trace’ and ‘Stop Trace’ buttons actually <strong>DO NOT</strong> start a trace at all. They only change the value of Tracestart parameter in registry to 1 or to 0 respectively.</p>
<p>Somewhere in the heart of AOS’ server process, there is a separate thread which wakes up every second and check the value of TraceStart parameter in the registry. If the value of this parameter has changed from 0 to 1, this thread reads all other tracing related parameters from the registry (these parameters described in more details on Trace Parser’s manual) and starts the trace. If the value of this parameter has changed from 1to 0, this thread stop the trace.</p>
<p>So – If you want to start trace on live system, You need not restart AOS Service. You can just set necessary tracing parameters, then press Apply button to store them into registry (do not agree to restart service if Configuration Utility will try to propose it) and then just press ‘Start Trace” to set TraceStart Parameter value to 1. AOS will check the registry for changes and start tracing just in  few seconds.</p>
<p>The very first time, when I tried to run server trace I’ve faced the situation when my log directory, where I had expected to see trace file, was empty and my event log had rather cryptic error message from AOS Server:”<strong>Fail to start ETW tracing session: return code is 5</strong>”. After spending several hours trying to reinstall and reconfigure everything in my system, I figured out, that probably tracing is started with standard <a href="http://msdn.microsoft.com/en-us/library/aa364117(VS.85).aspx">StartTrace</a> WinAPI function, so 5 is an error code described in detail in the MSDN’s description of this function. Actually, this description is quite useful when You have some strange error message from Axapta’s ETW tool and You are trying to figure out what is happening. Moreover, this article has detailed description of all these in/max buffer and buffer size registry parameters, which, according to Trace Parser’s manual You should set before actual attempt to collect the trace.</p>
<p>From reading of the mentioned article, I comprehend two important rule related to security and ETW in Dynamics AX:</p>
<ol>
<li>The AOS’ user must belong to the ‘Performance Log Users’ user group if it is running on Windows Server 2003 or 2008. WMI event tracing subsystem requires that tracing can be started <strong>ONLY</strong> from user belonging to the user group or to Administrators user group. Since the idea of including AOS’ user into Admin group sounds completely wrong, the only solution is to include AOS’ user into ‘Performance Log Users’ group.</li>
<li>The AOS’ user must have full access rights to server’s log directory.</li>
</ol>
<p>Once, I also saw the ”<strong>Fail to start ETW tracing session: return code is 132</strong>” error message. It was caused by incorrect setting of tracefilesize in Dynamics AX configuration in registry. By default, this setting is set to 10000. So, on attempt to start tracing, WMI Event tracing subsystem checks that target drive for log file has 10000 MBytes available (10Gbytes actually). If available space is less than 10Gbytes, attempt to start tracing fails with the error message mentioned. I recommend to set this setting to something like 1000, because actually Trace Parser tools tends to choke on attempt to import event file larger than several hundreds megabytes.</p>
<p>A Trace log file, with the results of tracing session is created in server’s log directory and has binary format. Result of the tracing can be analyzed via usage of Trace Parser tool, available somewhere at Microsoft’s PartnerSource site.</p>
<p>Another small hint: First time then You try to work with server trace in trace parser tool, do not forget to select correct user in a small window in the upper left corner of the trace form. It seems obvious, but on my first try I spend couple of minutes trying to comprehend relation between what I had been doing in Axapta and what I saw on a screen. Somehow, It did not occur to me immediately that server tracing actually collect trace for ALL current user on a server.</p>
<p>Also – Keep in mind that if server has around 150-200 users, then server trace will produce around 150-300 MBytes of trace data every minute, so do not keep tracing your server longer than necessary.</p>
<p>Now, I want to discuss, why I consider Server Tracing extremely important for every DAX implementation technician. Most of developers heard that this tracing can be used for performance profiling of application. It is true. But actually, there is much more interesting application of Sever Tracing. You can treat it as a magical almost non-intrusive flight recorder which can be used to pip into already running application which suddenly went crazy and you do not have an idea what is happening. Say – You have a call from end-user, who complained that scheduling for one production order already took 20 minutes and still is running, while normally it take no more than a minute. You must try to start server tracing ASAP! Even if this scheduling finish in a minute or so, You hopefully would have enough trace data to analyze the situation later on.</p>
<p>As a conclusion: I consider Server Trace as a primary tool for nailing down floating errors, which does not have clear reproduction scenario by now.</p>
<h3>Client tracing</h3>
<p>First of all: You will be surprised, but Client Tracing just does not work in default installation. At least, all dynamics ax installations, I’ve checked does not have appropriate trace provider installed. I do not know, whatever it is an error or feature of Dynamics Installer. Before attempt to start client tracing, please run ‘logman query providers’ command and check whatever the command’s output has line starting with “AX Trace” in it. If it is not the case, first thing You should install AX Trace provider by running mofcomp ax_trace.mof from DAX Client’s bin directory. (In case of Vista/W7/WS2008, mofcomp must be run with elevated privileges).</p>
<p>The approach used for starting client tracing is similar to the approach used to start server tracing. Client periodically (I think – in the main message loop) checks the value of TraceStart parameter in the corresponding section of registry. If the value of the parameter has changed from 0 to 1, client starts tracing and so on.</p>
<p>So – The basic approach to starting/stopping tracing on a client side is the same as in case of server side tracing.</p>
<p>Here are several hints on Client Tracing.</p>
<ol>
<li>Client tracing only works if Axapta’s client is started with Administrative privileges. This requirement arises from usage of StartTrace function. I believe, If you include yourself into “Performance Log Users”, it would achieve the same result, but I never have tried this. Actually, when I need to run client trace I simply start DAX Client in “Run as Administrator” mode.</li>
<li>FIles with client trace are located in Client’s log directory. In default configuration it is set to \Users\Public\Microsoft\Dynamics Ax\Log\ or \Document and Settings\All Users\Microsoft\Dynamics Ax\Log\.</li>
<li>As I said – You can start tracing at any time, by pressing “Start Trace” button in client configuration utility. Since the client checks registry settings less regularly than server, expect some delay between pressing the button and actual start of client tracing.</li>
</ol>
<p>In a conclusion, I want to mention that client tracing is the most useless kind of a tracing in Axapta. First of all, normally most of business logic is performed on a server side (so no much to see on a client side trace). Second, client trace does not contain information about performed SQL statements at all. (Since statements are always executed on server side).</p>
]]></content:encoded>
			<wfw:commentRss>http://fedotenko.info/?feed=rss2&amp;p=164</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cost Explorer in DAX2009</title>
		<link>http://fedotenko.info/?p=123</link>
		<comments>http://fedotenko.info/?p=123#comments</comments>
		<pubDate>Mon, 23 Nov 2009 13:25:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Logistics]]></category>
		<category><![CDATA[Costing]]></category>

		<guid isPermaLink="false">http://fedotenko.info/?p=123</guid>
		<description><![CDATA[It seems that not every Axapta user/consultant is aware about the powerful debugging tool for cost related issues, introduced in DAX2009. This tool is a Cost Explorer form, which is available from Inventory->Cost Explorer button in any of different Inventory Transactions forms. Basically, this form allows you to trace down to the deepest cost sources [...]]]></description>
			<content:encoded><![CDATA[<p>It seems that not every Axapta user/consultant is aware about the powerful debugging tool for cost related issues, introduced in DAX2009. This tool is a Cost Explorer form, which is available from Inventory->Cost Explorer button in any of different Inventory Transactions forms. Basically, this form allows you to trace down to the deepest cost sources of any inventory transaction. The most important difference between this form and the Trace form, available starting from ancient versions of Axapta, is that the Cost Explorer form fetches tracing information from the Inventory Settlement data, while the Trace form just settle issue to receipts on the fly. This makes the Cost Explorer form to be a powerful cost debugging tool, which allows you to deconstruct a cost of any inventory transaction. Say &#8211; You open the form for closed inventory transaction for sales order. After expanding the cost sources for this transaction, you see that it cost originated from two receipt transactions &#8211; one is a production order and another is a transfer order from a different warehouse. By expanding receipt node for the transfer, you find that this transfer cost is originating in a production order, then that production order&#8217;s cost is originating from three purchases and one transfer order, which,in turn, originates from fourth purchase order. So, after considerable number of mouse clicks, You would find all the originating inventory transactions and understand the source for every cent of the cost price of the issue in question. Here is  little more details about the form:<br />
1. The form can be called for receipt and issue inventory transactions.<br />
2. For an inventory receipt, the form can show not only transaction data itself, but also all the adjustments made for the receipt. The cost structure engine can even differentiate between kinds of adjustment (On Hand Adjustment/Transaction Adjustment, Rounding during inventory closing, Standard Cost adjustment, Other types of adjustment).<br />
3. For a receipt from production order, even data from route transactions (essentially &#8211; non-material part of cost) are displayed.<br />
4. For an inventory transaction, the cost tree node text shows Item No, financial inventory dimension, Item Name, Transaction Type, Order number (like PO&#8217;s number, Inventory journal&#8217;s Number), Settled Qty from this transaction, cost contribution per settled piece (basically &#8211; settledValue/settledQty), Settled Value.<br />
5. For a receipt adjustment, the cost tree node text shows type of adjustment, settled Qty from transaction adjusted,cost contribution per settled piece (basically &#8211; adjustmentValue/settledQty), Adjustment Value.<br />
6. The form displays the adjustments made ONLY before the date of the last inventory closing. If you want to analyze ALL the adjustments for given receipt transaction, You should not rely on this info. To analyze all the adjustments &#8211; just open the Settlements form for given inventory transaction.</p>
<p>When I am talking about Settled Qty, I mean &#8220;Quantity contribution&#8221; of this transaction into the top-level transaction, for which the Cost Explorer form has been started.  Say &#8211; We have a purchase order for 30 pieces of raw material, production order, which consumes all 30 pieces of raw material and produces 6 pieces of finish good and we have sales order, which sells 2 pieces of finish goods. So &#8211; If we try to trace the cost structure down from sales order to purchase order, then for settlements from purchase order receipts to production order issues, we would see Settlement Quantity of 10 (despite the fact, that all 30 pieces from receipt has been settled to issues during the last inventory closing). This is because we are analyzing the cost structure from Sales Order, which has sold only 1/3 of finish goods. So &#8211; Only 10 pieces of original purchase have contributed into COGS.<br />
It should be mentioned also, that contributed cost value from some receipts can be LESSER then 1 cent (eurocent, kopek, etc). This is perfectly normal. If the cost value of the issue in question is not equal to the total of originating receipts contributions into cost, just try to increase number of decimals on the Setup tab of the form.</p>
<p>Finally, I want to mention, that although this form works perfectly well, it leaves overall impression of a kludge made to quickly fix the problem. The cost data is being gathered through too many sources; Approach for cost structure display is not aligned with cost group and cost breakdown mechanisms introduced in DAX2009.<br />
I hope that in some of the future versions, Axapta would introduce some high level engine for cost structure analysis and manipulation, which would disconnect cost data from all this inventory transactions, inventory settlements, indirect cost transactions, route transactions, markup transactions and so on. It would be a great advantage for the costing process in Axapta.</p>
]]></content:encoded>
			<wfw:commentRss>http://fedotenko.info/?feed=rss2&amp;p=123</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update to the IC article</title>
		<link>http://fedotenko.info/?p=113</link>
		<comments>http://fedotenko.info/?p=113#comments</comments>
		<pubDate>Mon, 02 Nov 2009 13:18:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Inventory costing]]></category>
		<category><![CDATA[Logistics]]></category>

		<guid isPermaLink="false">http://fedotenko.info/?p=113</guid>
		<description><![CDATA[Section on Inventory closing for Physical inventory transactions is just added.
]]></description>
			<content:encoded><![CDATA[<p>Section on <a href="http://fedotenko.info/?page_id=31#Physically_updated_inventory_transactions_in_IC">Inventory closing for Physical inventory transactions</a> is just added.</p>
]]></content:encoded>
			<wfw:commentRss>http://fedotenko.info/?feed=rss2&amp;p=113</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>History of inventory locking in DAX</title>
		<link>http://fedotenko.info/?p=85</link>
		<comments>http://fedotenko.info/?p=85#comments</comments>
		<pubDate>Mon, 28 Sep 2009 10:05:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Logistics]]></category>
		<category><![CDATA[Inventory]]></category>
		<category><![CDATA[Locking]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://fedotenko.info/?p=85</guid>
		<description><![CDATA[I&#8217;ve just translated and published my old article on the history of the inventory data locking in Dynamics AX. Well &#8211; It was written as a kind of sales driver for  Dynamics AX 4.0, because improvement in inventory locking was the only actually useful improvement of DAX 4.0 against DAX 3.0.   Maybe [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just translated and published my old <a href="http://fedotenko.info/?page_id=73">article</a> on the history of the inventory data locking in Dynamics AX. Well &#8211; It was written as a kind of sales driver for  Dynamics AX 4.0, because improvement in inventory locking was the only actually useful improvement of DAX 4.0 against DAX 3.0. <img src='http://fedotenko.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Maybe this article is not that actual by now, because most of customers has moved to DAX 4.0 already, but it can be useful for developers and architects to understand the history and reasoning for the current approach to inventory on-hand data locking and update&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://fedotenko.info/?feed=rss2&amp;p=85</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Costing and inventory closing</title>
		<link>http://fedotenko.info/?p=39</link>
		<comments>http://fedotenko.info/?p=39#comments</comments>
		<pubDate>Tue, 22 Sep 2009 10:58:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Inventory costing]]></category>
		<category><![CDATA[Logistics]]></category>
		<category><![CDATA[Costing]]></category>
		<category><![CDATA[FIFO]]></category>
		<category><![CDATA[Inventory closing]]></category>
		<category><![CDATA[LIFO]]></category>
		<category><![CDATA[Standard Cost]]></category>

		<guid isPermaLink="false">http://fedotenko.info/?p=39</guid>
		<description><![CDATA[Article on Inventory closing and costing has been published. It is a translation from Russian original, first published 2+ years ago in my old blog (http://blogs.technet.com/denisfed/). The translation generally retained info from the old article, but has been cleaned from some peculiarities of Russian accounting and Russian localization of Dynamics AX.
]]></description>
			<content:encoded><![CDATA[<p>Article on <a href="http://fedotenko.info/?page_id=31" target="_self">Inventory closing and costing </a>has been published. It is a translation from Russian original, first published 2+ years ago in my old blog (http://blogs.technet.com/denisfed/). The translation generally retained info from the old article, but has been cleaned from some peculiarities of Russian accounting and Russian localization of Dynamics AX.</p>
]]></content:encoded>
			<wfw:commentRss>http://fedotenko.info/?feed=rss2&amp;p=39</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
