<?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>Art Of Creation - Dynamics AX Blog</title>
	<atom:link href="http://www.artofcreation.be/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.artofcreation.be</link>
	<description>The everyday life of a Dynamics AX developer</description>
	<lastBuildDate>Fri, 23 Jul 2010 16:29:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Linked server sql statements</title>
		<link>http://www.artofcreation.be/2010/07/23/linked-server-sql-statements/</link>
		<comments>http://www.artofcreation.be/2010/07/23/linked-server-sql-statements/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 16:29:55 +0000</pubDate>
		<dc:creator>Klaas Deforche</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Linked server]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.artofcreation.be/?p=826</guid>
		<description><![CDATA[Hi all, hope you are well. Some time ago, I talked about executing direct sql statements, and now I want to share some sql statements that I used to manage linked server connections. What follows are 4 sql statements that allow you to add en remove linked servers on a database at runtime. Some assumptions: [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all, hope you are well. </p>
<p>Some time ago, I talked about <a href="http://www.artofcreation.be/2010/06/21/executing-direct-sql-statements/">executing direct sql statements</a>, and now I want to share some sql statements that I used to manage linked server connections. </p>
<p>What follows are 4 sql statements that allow you to add en remove linked servers on a database at runtime. </p>
<p>Some assumptions:<br />
- There is a str variable named &#8220;query&#8221; that will contain the query<br />
- there is a parm method on the class that return the sql server (&#8220;server&#8221; or &#8220;server\instance&#8221;)<br />
- there is a parm method that returns a username<br />
- there is a parm method that returns a password</p>
<p><strong>Check if linked server exist</strong><br />
First check if the linked server doesn&#8217;t exist yet, or you will get an error when you try to add one that already exists.</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">query <span style="color: #00007f;">=</span> <span style="color: #0000ff;">strfmt</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;select top 1 * from sys.servers where name = '%1'&quot;</span><span style="color: #00007f;">,</span> this.<span style="color: #000000;">parmServer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;</div></div>
<p><strong>Add linked server</strong><br />
When the linked server doesn&#8217;t exist, add it.</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">query <span style="color: #00007f;">=</span> <span style="color: #0000ff;">strfmt</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;EXEC sp_addLinkedServer @server = '%1', @srvproduct=N'SQL Server'&quot;</span><span style="color: #00007f;">,</span> this.<span style="color: #000000;">parmServer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;</div></div>
<p><strong>Add linked server login</strong><br />
Optionally, you can add a login that will be used to connect to the linked server.</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">query <span style="color: #00007f;">=</span> <span style="color: #0000ff;">strfmt</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;sp_addlinkedsrvlogin @rmtsrvname = '%1' ,@useself = FALSE, @locallogin = NULL, @rmtuser = '%2', @rmtpassword = '%3'&quot;</span><span style="color: #00007f;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.<span style="color: #000000;">parmServer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #00007f;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.<span style="color: #000000;">parmUsername</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #00007f;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.<span style="color: #000000;">parmPassword</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;</div></div>
<p><strong>Remove linked server</strong><br />
Optionally, you can remove the linked server.</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">query <span style="color: #00007f;">=</span> <span style="color: #0000ff;">strfmt</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;EXEC sp_dropserver '%1', 'droplogins'&quot;</span><span style="color: #00007f;">,</span> this.<span style="color: #000000;">parmServer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.artofcreation.be/2010/07/23/linked-server-sql-statements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamics AX 2009 RU5 backwards compatibility problem</title>
		<link>http://www.artofcreation.be/2010/07/22/dynamics-ax-2009-ru5-backwards-compatibility-problem/</link>
		<comments>http://www.artofcreation.be/2010/07/22/dynamics-ax-2009-ru5-backwards-compatibility-problem/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 12:43:55 +0000</pubDate>
		<dc:creator>Klaas Deforche</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Application]]></category>
		<category><![CDATA[hotfix]]></category>
		<category><![CDATA[Roll up]]></category>

		<guid isPermaLink="false">http://www.artofcreation.be/?p=855</guid>
		<description><![CDATA[Hi all! There seems to be a problem with the recently released RU5 for Dynamics AX 2009 SP1. Dynamics AX clients are supposed to be backwards compatible, so you can always use the latest client, even if you want to connect to an application with a lower version (e.g. AX 2009 RU4 client to AX [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all!</p>
<p>There seems to be a problem with the recently released RU5 for Dynamics AX 2009 SP1.<br />
Dynamics AX clients are supposed to be backwards compatible, so you can always use the latest client, even if you want to connect to an application with a lower version (e.g. AX 2009 RU4 client to AX 2009 RU3 application).</p>
<p>But when I tried to connect to an AX 2009 RU3 application (5.0.1500.1313) after I updated my client to RU5 (5.0.1500.2985), it didn&#8217;t work.<br />
Dynamics AX only shows the first record in the forms when you use that combination, as you can see in the screenshot below.<br />
<div id="attachment_857" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.artofcreation.be/wp-content/uploads/screensRU5_ts.png"><img src="http://www.artofcreation.be/wp-content/uploads/screensRU5_ts-300x228.png" alt="Roll up 5 screenshot" title="Roll up 5" width="300" height="228" class="aligncenter size-medium wp-image-857" /></a><p class="wp-caption-text">Roll up 5</p></div></p>
<p>When you connect using a RU4 client (or RU3), there is no problem at all.<br />
<div id="attachment_857" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.artofcreation.be/wp-content/uploads/screensRU4_ts.png"><img src="http://www.artofcreation.be/wp-content/uploads/screensRU4_ts-300x228.png" alt="" title="Roll up 4 client" width="300" height="228" class="aligncenter size-medium wp-image-863" /></a><p class="wp-caption-text">Roll up 4</p></div></p>
<p>You can uninstall a hotfix rollup from the Add/Remove software screen in the windows control panel if you want to. </p>
<p>I prefer to duplicate the client folder each time I upgrade it so I have all client versions available.<br />
Just fire up bin\ax32.exe for the version you want and you good to go :-).<br />
<a href="http://www.artofcreation.be/wp-content/uploads/clients.png"><img src="http://www.artofcreation.be/wp-content/uploads/clients.png" alt="" title="Client versions" width="584" height="300" class="aligncenter size-full wp-image-865" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.artofcreation.be/2010/07/22/dynamics-ax-2009-ru5-backwards-compatibility-problem/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Forms Tutorial_Resources and SysImageResources</title>
		<link>http://www.artofcreation.be/2010/06/28/forms-tutorial_resources-and-sysimageresources/</link>
		<comments>http://www.artofcreation.be/2010/06/28/forms-tutorial_resources-and-sysimageresources/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 17:10:00 +0000</pubDate>
		<dc:creator>Klaas Deforche</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Forms]]></category>

		<guid isPermaLink="false">http://www.artofcreation.be/?p=828</guid>
		<description><![CDATA[On multiple occasions, you can add an icon to an object. Like for example on menus. You can add an image by setting the NormalImage property to a path, or you can use the NormalResource property. The only problem with the NormalResource property is that it asks for an integer. But how do you know [...]]]></description>
			<content:encoded><![CDATA[<p>On multiple occasions, you can add an icon to an object. Like for example on menus. You can add an image by setting the NormalImage property to a path, or you can use the NormalResource property. </p>
<p>The only problem with the NormalResource property is that it asks for an integer. But how do you know what integer the icon has that you want to use?</p>
<p>You can use this form:<br />
<a href="http://www.artofcreation.be/wp-content/uploads/resources.png"><img src="http://www.artofcreation.be/wp-content/uploads/resources.png" alt="" title="resources" width="334" height="445" class="aligncenter size-full wp-image-830" /></a></p>
<p>Depending on what AX version you are using, the name of the form is different:<br />
Dynamics AX 4: form Tutorial_Resources<br />
Dynamics AX 2009: form SysImageResources</p>
<p>For some reason, Microsoft changed the name of that form in AX 2009, and because I started working with AX version 4.0, I always forget the name of that new form :-). </p>
<p>Update: in AX 2009, you can also open this form in the AX menu; click Tools &#8211; Development Tools &#8211; Embedded resources.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.artofcreation.be/2010/06/28/forms-tutorial_resources-and-sysimageresources/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Executing direct SQL statements</title>
		<link>http://www.artofcreation.be/2010/06/21/executing-direct-sql-statements/</link>
		<comments>http://www.artofcreation.be/2010/06/21/executing-direct-sql-statements/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 16:35:22 +0000</pubDate>
		<dc:creator>Klaas Deforche</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Datasource]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.artofcreation.be/?p=796</guid>
		<description><![CDATA[Hi everyone, Today I want to talk about executing SQL statements in X++ on both the AX database and external databases. This is something probably every AX developer will have to do at some point. You&#8217;ll want to do this for many reasons; to execute stored procedures, to improve performance, to get data from an [...]]]></description>
			<content:encoded><![CDATA[<p>Hi everyone, </p>
<p>Today I want to talk about executing SQL statements in X++ on both the AX database and external databases. This is something probably every AX developer will have to do at some point.</p>
<p>You&#8217;ll want to do this for many reasons; to execute stored procedures, to improve performance, to get data from an external database, and so on. </p>
<p>I will provide samples for two classes:<br />
- Connection (Execute SQL statement on current AX database)<br />
- ODBCConnection (Execute SQL statement on external database)</p>
<p>I will not cover the ADO connection (CCADOConnection class), because it doesn&#8217;t work when you run it on server (or in batch), and I don&#8217;t like that. If you do, try to convince me ;-). </p>
<h3>Executing direct SQL on the current AX database</h3>
<p>When you execute a SQL statement, there are two options:<br />
- either you did a select and you expect a result to be returned<br />
- or you did insert/update/delete and you don&#8217;t expect a result. </p>
<p>The first sample is for a SQL statement that returns a result:</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">server</span> <span style="color: #0000ff;">void</span> main<span style="color: #000000;">&#40;</span>Args _args<span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; Connection &nbsp; &nbsp; &nbsp;connection;<br />
&nbsp; &nbsp; Statement &nbsp; &nbsp; &nbsp; statement;<br />
&nbsp; &nbsp; <span style="color: #0000ff;">str</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; query;<br />
&nbsp; &nbsp; Resultset &nbsp; &nbsp; &nbsp; resultSet;<br />
&nbsp; &nbsp; ;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// create connection object</span><br />
&nbsp; &nbsp; connection <span style="color: #00007f;">=</span> <span style="color: #0000ff;">new</span> Connection<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// create statement</span><br />
&nbsp; &nbsp; statement <span style="color: #00007f;">=</span> connection.<span style="color: #000000;">createStatement</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// Set the SQL statement</span><br />
&nbsp; &nbsp; query <span style="color: #00007f;">=</span> <span style="color: #ff0000;">'select name from CustTable'</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// assert SQL statement execute permission</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">new</span> SqlStatementExecutePermission<span style="color: #000000;">&#40;</span>query<span style="color: #000000;">&#41;</span>.<span style="color: #000000;">assert</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// when the query returns result,</span><br />
&nbsp; &nbsp; <span style="color: #007f00;">// loop all results for processing</span><br />
&nbsp; &nbsp; <span style="color: #007f00;">//BP Deviation documented</span><br />
&nbsp; &nbsp; resultSet <span style="color: #00007f;">=</span> statement.<span style="color: #000000;">executeQuery</span><span style="color: #000000;">&#40;</span>query<span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">while</span><span style="color: #000000;">&#40;</span>resultSet.<span style="color: #0000ff;">next</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007f00;">// do something with the result</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; info<span style="color: #000000;">&#40;</span>resultSet.<span style="color: #000000;">getString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// limit the scope of the assert call</span><br />
&nbsp; &nbsp; CodeAccessPermission<span style="color: #00007f;">::</span><span style="color: #000000;">revertAssert</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span></div></div>
<p>Note: this is a main method, put it in a class. Also note that it has to run on server. </p>
<p>Now if you do an update/delete/insert, you will want to do something like this:</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">server</span> <span style="color: #0000ff;">void</span> main<span style="color: #000000;">&#40;</span>Args _args<span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; Connection &nbsp; &nbsp; &nbsp;connection;<br />
&nbsp; &nbsp; Statement &nbsp; &nbsp; &nbsp; statement;<br />
&nbsp; &nbsp; <span style="color: #0000ff;">str</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; query;<br />
&nbsp; &nbsp; ;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// create connection object</span><br />
&nbsp; &nbsp; connection <span style="color: #00007f;">=</span> <span style="color: #0000ff;">new</span> Connection<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// create statement</span><br />
&nbsp; &nbsp; statement <span style="color: #00007f;">=</span> connection.<span style="color: #000000;">createStatement</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// Set the SQL statement</span><br />
&nbsp; &nbsp; query <span style="color: #00007f;">=</span> <span style="color: #ff0000;">&quot;insert into CustTable (AccountNum, Name, RecId) values ('demo', 'demo', 2)&quot;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// assert SQL statement execute permission</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">new</span> SqlStatementExecutePermission<span style="color: #000000;">&#40;</span>query<span style="color: #000000;">&#41;</span>.<span style="color: #000000;">assert</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">//BP Deviation documented</span><br />
&nbsp; &nbsp; statement.<span style="color: #000000;">executeUpdate</span><span style="color: #000000;">&#40;</span>query<span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// limit the scope of the assert call</span><br />
&nbsp; &nbsp; CodeAccessPermission<span style="color: #00007f;">::</span><span style="color: #000000;">revertAssert</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span></div></div>
<p>You can find more info about the executeQuery() and executeUpdate() methods on msdn:<br />
<a href="http://msdn.microsoft.com/en-us/library/aa861335.aspx">Statement Class</a></p>
<h3>Executing direct SQL on an external database using ODBC</h3>
<p>Again, we have to differentiate between queries that return a result and those that don&#8217;t. </p>
<p>The following code sample retrieves records from an external database and processes the result:</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">server</span> <span style="color: #0000ff;">void</span> main<span style="color: #000000;">&#40;</span>Args _args<span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; Statement &nbsp; &nbsp; &nbsp; statement;<br />
&nbsp; &nbsp; <span style="color: #0000ff;">str</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; query;<br />
&nbsp; &nbsp; Resultset &nbsp; &nbsp; &nbsp; resultSet;<br />
&nbsp; &nbsp; LoginProperty &nbsp; loginProperty;<br />
&nbsp; &nbsp; OdbcConnection &nbsp;odbcConnection;<br />
&nbsp; &nbsp; ;<br />
<br />
&nbsp; &nbsp; loginProperty <span style="color: #00007f;">=</span> <span style="color: #0000ff;">new</span> LoginProperty<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; loginProperty.<span style="color: #000000;">setDSN</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'YOURDSN'</span><span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; odbcConnection <span style="color: #00007f;">=</span> <span style="color: #0000ff;">new</span> OdbcConnection<span style="color: #000000;">&#40;</span>loginProperty<span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// Create new Statement instance</span><br />
&nbsp; &nbsp; statement <span style="color: #00007f;">=</span>odbcConnection.<span style="color: #000000;">CreateStatement</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// Set the SQL statement</span><br />
&nbsp; &nbsp; query <span style="color: #00007f;">=</span> <span style="color: #ff0000;">'select name from CustTable'</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// assert SQL statement execute permission</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">new</span> SqlStatementExecutePermission<span style="color: #000000;">&#40;</span>query<span style="color: #000000;">&#41;</span>.<span style="color: #000000;">assert</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// when the query returns result,</span><br />
&nbsp; &nbsp; <span style="color: #007f00;">// loop all results for processing by handler</span><br />
&nbsp; &nbsp; <span style="color: #007f00;">//BP Deviation documented</span><br />
&nbsp; &nbsp; resultSet <span style="color: #00007f;">=</span> statement.<span style="color: #000000;">executeQuery</span><span style="color: #000000;">&#40;</span>query<span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">while</span><span style="color: #000000;">&#40;</span>resultSet.<span style="color: #0000ff;">next</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007f00;">// do something with the result</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; info<span style="color: #000000;">&#40;</span>resultSet.<span style="color: #000000;">getString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// limit the scope of the assert call</span><br />
&nbsp; &nbsp; CodeAccessPermission<span style="color: #00007f;">::</span><span style="color: #000000;">revertAssert</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span></div></div>
<p>As you can see, the code is pretty similar. The main difference is that we are using ODBC classes, including the LoginProperty class. </p>
<p>In this example, I use a DSN (Data Source Name) that I configured on the AOS server. The DSN contains a reference to the server and database you want to connect to, and also what user credentials should be used to connect to the database. This is a lot safer than storing them in AX.<br />
If you don&#8217;t know how to create a DSN, there are plenty of <a href="http://www.google.com/search?q=create+ODBC+Data+Source+Name">tutorials on the web</a>.</p>
<p>To update/delete/update, the code is more or less the same:</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">server</span> <span style="color: #0000ff;">void</span> main<span style="color: #000000;">&#40;</span>Args _args<span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; Statement &nbsp; &nbsp; &nbsp; statement;<br />
&nbsp; &nbsp; <span style="color: #0000ff;">str</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; query;<br />
&nbsp; &nbsp; LoginProperty &nbsp; loginProperty;<br />
&nbsp; &nbsp; OdbcConnection &nbsp;odbcConnection;<br />
&nbsp; &nbsp; ;<br />
<br />
&nbsp; &nbsp; loginProperty <span style="color: #00007f;">=</span> <span style="color: #0000ff;">new</span> LoginProperty<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; loginProperty.<span style="color: #000000;">setDSN</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'YOURDSN'</span><span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; odbcConnection <span style="color: #00007f;">=</span> <span style="color: #0000ff;">new</span> OdbcConnection<span style="color: #000000;">&#40;</span>loginProperty<span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// Create new Statement instance</span><br />
&nbsp; &nbsp; statement <span style="color: #00007f;">=</span>odbcConnection.<span style="color: #000000;">CreateStatement</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// Set the SQL statement</span><br />
&nbsp; &nbsp; query <span style="color: #00007f;">=</span> <span style="color: #ff0000;">&quot;insert into CustTable (AccountNum, Name, RecId) values ('demo', 'demo', 2)&quot;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// assert SQL statement execute permission</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">new</span> SqlStatementExecutePermission<span style="color: #000000;">&#40;</span>query<span style="color: #000000;">&#41;</span>.<span style="color: #000000;">assert</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// when the query returns result,</span><br />
&nbsp; &nbsp; <span style="color: #007f00;">// loop all results for processing by handler</span><br />
&nbsp; &nbsp; <span style="color: #007f00;">//BP Deviation documented</span><br />
&nbsp; &nbsp; statement.<span style="color: #000000;">executeUpdate</span><span style="color: #000000;">&#40;</span>query<span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// limit the scope of the assert call</span><br />
&nbsp; &nbsp; CodeAccessPermission<span style="color: #00007f;">::</span><span style="color: #000000;">revertAssert</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span></div></div>
<p>If you feel that something is missing in these examples, just ask. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.artofcreation.be/2010/06/21/executing-direct-sql-statements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Now part of the Dynamics AX Community</title>
		<link>http://www.artofcreation.be/2010/06/02/now-part-of-the-dynamics-ax-community/</link>
		<comments>http://www.artofcreation.be/2010/06/02/now-part-of-the-dynamics-ax-community/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 20:52:04 +0000</pubDate>
		<dc:creator>Klaas Deforche</dc:creator>
				<category><![CDATA[Site news]]></category>
		<category><![CDATA[Community]]></category>

		<guid isPermaLink="false">http://www.artofcreation.be/?p=782</guid>
		<description><![CDATA[Hi everyone, Just to announce that this blog is now part of the Dynamics AX Community. You can read all about it in this warm welcome message on the Microsoft Dynamics AX Community Team blog. While you are at it, create a profile (if you don&#8217;t already have one), because with the newsgroups closing any [...]]]></description>
			<content:encoded><![CDATA[<p>Hi everyone,</p>
<p>Just to announce that this blog is now part of the Dynamics AX Community. </p>
<p>You can read all about it in <a href="https://community.dynamics.com/blogs/axnews/archive/2010/06/02/the-community-welcomes-klaas-deforche-our-newest-microsoft-dynamics-ax-technical-blogger.aspx">this warm welcome message</a> on the Microsoft Dynamics AX Community Team blog. </p>
<p>While you are at it, create a profile (if you don&#8217;t already have one), because with the <a href="http://www.artofcreation.be/2010/05/10/microsoft-closing-ax-newsgroups/">newsgroups closing</a> any time now, the Dynamics AX Community is the place to be for all your community needs. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.artofcreation.be/2010/06/02/now-part-of-the-dynamics-ax-community/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Normalization dilemma</title>
		<link>http://www.artofcreation.be/2010/05/29/normalization-dilemma/</link>
		<comments>http://www.artofcreation.be/2010/05/29/normalization-dilemma/#comments</comments>
		<pubDate>Fri, 28 May 2010 22:42:49 +0000</pubDate>
		<dc:creator>Klaas Deforche</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://www.artofcreation.be/?p=754</guid>
		<description><![CDATA[Hi all! I have a dilemma, and would like your opinions. The situation is that I want to add fields to an existing table (say InventTable) What would you prefer: So the question is, should I add new fields to the table (option one), or should I create a new table with the fields and [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all!</p>
<p>I have a dilemma, and would like your opinions.<br />
The situation is that I want to add fields to an existing table (say InventTable)</p>
<p>What would you prefer:<br />
<a href="http://www.artofcreation.be/wp-content/uploads/fieldortable.png"><img src="http://www.artofcreation.be/wp-content/uploads/fieldortable.png" alt="Add fields or table" title="Normalization" class="size-full wp-image-763" /></a></p>
<p>So the question is, should I add new fields to the table (option one), or should I create a new table with the fields and link to it. (option 2)  </p>
<p>Normally, option 1 is the standard way of adding extra fields to a table, but option 2 has a few advantages:</p>
<ul>
<li>You don&#8217;t need to modify the existing table</li>
<li>You&#8217;ll have less trouble with these fields when you have to upgrade AX</li>
<li>It will be easier to deploy your modifications in an AX environment that already contains modifications to the table</li>
</ul>
<p>There are also a few disadvantages I can think of:</p>
<ul>
<li>You have to join 2 tables to get the data from the new fields</li>
<li>You can&#8217;t add the new fields to fields groups on the main table (InventTable in this example)</li>
<li>On forms, you will have to add a new data source, or add display fields</li>
</ul>
<p>I would certainly go for option 1 when doing customizations for a customer, but would consider option 2 for product development. I&#8217;m in doubt. How about you? </p>
]]></content:encoded>
			<wfw:commentRss>http://www.artofcreation.be/2010/05/29/normalization-dilemma/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Creating a class, the best practice way</title>
		<link>http://www.artofcreation.be/2010/05/18/creating-a-class-the-best-practice-way/</link>
		<comments>http://www.artofcreation.be/2010/05/18/creating-a-class-the-best-practice-way/#comments</comments>
		<pubDate>Tue, 18 May 2010 11:40:20 +0000</pubDate>
		<dc:creator>Klaas Deforche</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Best practices]]></category>
		<category><![CDATA[Compiler]]></category>
		<category><![CDATA[Patterns]]></category>

		<guid isPermaLink="false">http://www.artofcreation.be/?p=723</guid>
		<description><![CDATA[Hi all! Some time ago, I talked about the &#8216;construct&#8217; pattern that is use a lot in AX. Although I use it often, it&#8217;s not perfect because it violates some best practices. (Also, you could end up with a large class hierarchy of classes that extend each other, but I&#8217;ll discuss that in an other [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all!</p>
<p>Some time ago, I talked about the &#8216;construct&#8217; pattern that is use a lot in AX. Although I use it often, it&#8217;s not perfect because it violates some best practices. (Also, you could end up with a large class hierarchy of classes that extend each other, but I&#8217;ll discuss that in an other post.)</p>
<p>First off, know that you can change the compiler level and the best practices the compiler checks.<br />
To do this, compile something so the compiler output window pops up. Then click the setup button, and adjust the settings.<br />
I used compiler level 4 and enabled all BP checks for this example. </p>
<p>So, let create a simple class. This class will simply print information of an InventTable record to the screen. </p>
<p><strong>1. ClassDeclaration</strong><br />
When we think about this class a bit, we immediately realize that we need to declare an InventTable record as a member of out class:</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007f00;">/// &lt;summary&gt;</span><br />
<span style="color: #007f00;">/// Class written to test construct and new... patterns</span><br />
<span style="color: #007f00;">/// &lt;/summary&gt;</span><br />
<span style="color: #007f00;">/// &lt;remarks&gt;</span><br />
<span style="color: #007f00;">/// Delete this class when proven a point :)</span><br />
<span style="color: #007f00;">/// &lt;/remarks&gt;</span><br />
<span style="color: #0000ff;">class</span> KLFORTestBP<br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; InventTable inventTable;<br />
<span style="color: #000000;">&#125;</span></div></div>
<p>Also note that I added documentation to this method. I will do so for other methods too. When you don&#8217;t, you&#8217;ll get a BP deviation warning. </p>
<p><strong>2. Parm method</strong><br />
One of the things that are important (or at least I find important), is using parm methods for your class variables. So, let&#8217;s create one:</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007f00;">// use parm methods to access class variables</span><br />
<span style="color: #0000ff;">public</span> InventTable parmInventTable<span style="color: #000000;">&#40;</span>InventTable _inventTable <span style="color: #00007f;">=</span> inventTable<span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; ;<br />
&nbsp; &nbsp; inventTable <span style="color: #00007f;">=</span> _inventTable;<br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">return</span> inventTable;<br />
<span style="color: #000000;">&#125;</span></div></div>
<p><strong>3. New method</strong><br />
You should never write code in the new method, or add parameters to it. On the contrary, you should always set this method to protected, and use a static construct() or a static new&#8230;() method instead.</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007f00;">// a new method should be protected</span><br />
<span style="color: #007f00;">// use static new... or construct instead</span><br />
<span style="color: #0000ff;">protected</span> <span style="color: #0000ff;">void</span> <span style="color: #0000ff;">new</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
<span style="color: #000000;">&#125;</span></div></div>
<p><strong>4. Run method</strong><br />
The run method will be our method that contains our logic. Here, we print info to the screen</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007f00;">/// &lt;summary&gt;</span><br />
<span style="color: #007f00;">/// Executes logic on the parameters of this class</span><br />
<span style="color: #007f00;">/// &lt;/summary&gt;</span><br />
<span style="color: #007f00;">/// &lt;remarks&gt;</span><br />
<span style="color: #007f00;">/// Just for demo purposes</span><br />
<span style="color: #007f00;">/// &lt;/remarks&gt;</span><br />
<span style="color: #0000ff;">public</span> <span style="color: #0000ff;">void</span> run<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; ;<br />
&nbsp; &nbsp; info<span style="color: #000000;">&#40;</span>this.<span style="color: #000000;">parmInventTable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #000000;">NameAlias</span><span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span></div></div>
<p>Note that we are using the parm method instead of directly accessing the variable. </p>
<p><strong>5. Construct method</strong><br />
Because the new method is now protected, we will need a contruct method to be able to create an instance of this class.</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">private</span> <span style="color: #0000ff;">static</span> KLFORTestBP construct<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; ;<br />
&nbsp; &nbsp; <span style="color: #0000ff;">return</span> <span style="color: #0000ff;">new</span> KLFORTestBP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span></div></div>
<p>When a class doesn’t need parameters, you can leave out the &#8216;private&#8217;, but now, it is private because we plan on creating a new&#8230;() method that contains parameters. A construct method shouldn&#8217;t contain parameters, and should only be used to create a new instance of your class. It is also the only place in your application where you can call the new() method of your class. </p>
<p><strong>6. New&#8230;() method</strong><br />
As said earlier, because we need a parameter (an InventTable record), we use a new&#8230;() instead of the construct method to create an instance of our class. I will name it newFromInventTable() based on the parameter it has.<br />
In this method, we call the contruct() method to create an instance (instead of new()), set the parm method from the parameter and return the object.</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007f00;">/// &lt;summary&gt;</span><br />
<span style="color: #007f00;">/// Creates a new KLFORTestBP object from an InventTable record</span><br />
<span style="color: #007f00;">/// &lt;/summary&gt;</span><br />
<span style="color: #007f00;">/// &lt;param name=&quot;_inventTable&quot;&gt;</span><br />
<span style="color: #007f00;">/// The InventTable used to create the object</span><br />
<span style="color: #007f00;">/// &lt;/param&gt;</span><br />
<span style="color: #007f00;">/// &lt;returns&gt;</span><br />
<span style="color: #007f00;">/// New instance of KLFORTestBP with the InventTable parameter set</span><br />
<span style="color: #007f00;">/// &lt;/returns&gt;</span><br />
<span style="color: #007f00;">/// &lt;remarks&gt;</span><br />
<span style="color: #007f00;">/// Use a new... method instead of the constuct method because it takes parameters/// A</span><br />
<span style="color: #007f00;">/// &lt;/remarks&gt;</span><br />
<span style="color: #0000ff;">public</span> <span style="color: #0000ff;">static</span> KLFORTestBP newFromInventTable<span style="color: #000000;">&#40;</span>InventTable _inventTable<span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; KLFORTestBP kLFORTestBP;<br />
&nbsp; &nbsp; ;<br />
<br />
&nbsp; &nbsp; kLFORTestBP <span style="color: #00007f;">=</span> KLFORTestBP<span style="color: #00007f;">::</span><span style="color: #000000;">construct</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; kLFORTestBP.<span style="color: #000000;">parmInventTable</span><span style="color: #000000;">&#40;</span>_inventTable<span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">return</span> kLFORTestBP;<br />
<span style="color: #000000;">&#125;</span></div></div>
<p>You could also create an init() method that initializes you class (we don&#8217;t need initialization now). The init() method should return a boolean if initialization can go wrong, so you can throw an error.<br />
It would look like this:</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">static</span> KLFORTestBP newFromInventTable<span style="color: #000000;">&#40;</span>InventTable _inventTable<span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; KLFORTestBP kLFORTestBP;<br />
&nbsp; &nbsp; ;<br />
<br />
&nbsp; &nbsp; kLFORTestBP <span style="color: #00007f;">=</span> KLFORTestBP<span style="color: #00007f;">::</span><span style="color: #000000;">construct</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; kLFORTestBP.<span style="color: #000000;">parmInventTable</span><span style="color: #000000;">&#40;</span>_inventTable<span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #000000;">&#40;</span><span style="color: #00007f;">!</span>kLFORTestBP.<span style="color: #000000;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">throw</span> error<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;Item record has no data&quot;</span><span style="color: #000000;">&#41;</span>; <span style="color: #007f00;">// todo: create label</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">return</span> kLFORTestBP;<br />
<span style="color: #000000;">&#125;</span></div></div>
<p>Remember to create a label for the text string, or you will get a best practice error. </p>
<p><strong>7. Main method</strong><br />
Now, all we need more is a main method, so this class is runable (by pressing F5 or as a menu item).</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">server</span> <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">void</span> main<span style="color: #000000;">&#40;</span>Args _args<span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; KLFORTestBP kLFORTestBP;<br />
&nbsp; &nbsp; InventTable inventTable;<br />
&nbsp; &nbsp; ;<br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #000000;">&#40;</span>_args <span style="color: #00007f;">&amp;&amp;</span> _args.<span style="color: #000000;">dataset</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00007f;">==</span> <span style="color: #0000ff;">tablenum</span><span style="color: #000000;">&#40;</span>InventTable<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007f00;">// a button was pressed on a InventTable datasource</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; inventTable <span style="color: #00007f;">=</span> _args.<span style="color: #000000;">record</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">else</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007f00;">// for demo, simple select the first one</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">select</span> <span style="color: #0000ff;">firstonly</span> inventTable;<br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// display item information</span><br />
&nbsp; &nbsp; kLFORTestBP <span style="color: #00007f;">=</span> KLFORTestBP<span style="color: #00007f;">::</span><span style="color: #000000;">newFromInventTable</span><span style="color: #000000;">&#40;</span>inventTable<span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; kLFORTestBP.<span style="color: #000000;">run</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span></div></div>
<p>Normally, you will get the record from the args object, but for demo purposes, I added the &#8216;select firstonly&#8217; so you can run the class by pressing F5. As you can see, the new&#8230;() method is used to create an instance of the class, and then the run method is called. </p>
<p><strong>There you go, you now have a best practice deviation free class!</strong></p>
<p><strong>8. Using the class</strong><br />
Using the class as a menu item or in code couldn&#8217;t be easier. </p>
<p>You can drag/drop the class to the action menu item node in the AOT to create a menu item, and you will be able to use it on any form with the inventTable datasource. </p>
<p>From code, you can simple write this line (assuming there is a variable called inventTable):</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">KLFORTestBP<span style="color: #00007f;">::</span><span style="color: #000000;">newFromInventTable</span><span style="color: #000000;">&#40;</span>inventTable<span style="color: #000000;">&#41;</span>.<span style="color: #000000;">run</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;</div></div>
<p><strong>Conclusion:</strong><br />
When writing code that doesn&#8217;t contain any best practice deviations (especially when checking them all on compiler level 4), you quickly end up with a lot of methods in your class and wondering if the effort is worth it. It can be a bit painful to get your code best practice deviation free.</p>
<p>However, you&#8217;ll also realise that following the best practices has its advantages. Your code will be cleaner, easier to understand, easier to debug because of the parm, constuct and run methods, less subject to change, contain less errors and your class will be used in the way you intended when you wrote it. </p>
<p>More info on MSDN:<br />
<a href="http://msdn.microsoft.com/en-us/library/aa854210.aspx">Best practices for constructors</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.artofcreation.be/2010/05/18/creating-a-class-the-best-practice-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AllowDuplicates Yes: Illegal property value</title>
		<link>http://www.artofcreation.be/2010/05/17/allowduplicates-yes-illegal-property-value/</link>
		<comments>http://www.artofcreation.be/2010/05/17/allowduplicates-yes-illegal-property-value/#comments</comments>
		<pubDate>Mon, 17 May 2010 16:06:22 +0000</pubDate>
		<dc:creator>Klaas Deforche</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Error]]></category>

		<guid isPermaLink="false">http://www.artofcreation.be/?p=716</guid>
		<description><![CDATA[When changing the property AllowDuplicates on a table index from No to Yes, the following error can be thrown at you: Illegal property Value This is because on your table, the property PrimaryIndex is set to the index you are trying to change.]]></description>
			<content:encoded><![CDATA[<p>When changing the property AllowDuplicates on a table index from No to Yes, the following error can be thrown at you:</p>
<blockquote><p>Illegal property Value</p></blockquote>
<p>This is because on your table, the property PrimaryIndex is set to the index you are trying to change. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.artofcreation.be/2010/05/17/allowduplicates-yes-illegal-property-value/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft closing AX newsgroups</title>
		<link>http://www.artofcreation.be/2010/05/10/microsoft-closing-ax-newsgroups/</link>
		<comments>http://www.artofcreation.be/2010/05/10/microsoft-closing-ax-newsgroups/#comments</comments>
		<pubDate>Mon, 10 May 2010 08:39:15 +0000</pubDate>
		<dc:creator>Klaas Deforche</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Newgroups]]></category>

		<guid isPermaLink="false">http://www.artofcreation.be/?p=711</guid>
		<description><![CDATA[Microsoft will begin closing its newsgroups, including the Dynamics AX newsgroups, as announced here: http://www.microsoft.com/communities/newsgroups/default.mspx It&#8217;s a shame, because I visit the AX development group using the web based news reader daily, and I will miss it. Where will we go now? To the Dynamics Forums?]]></description>
			<content:encoded><![CDATA[<p>Microsoft will begin closing its newsgroups, including the Dynamics AX newsgroups, as announced here:<br />
<a href="http://www.microsoft.com/communities/newsgroups/default.mspx">http://www.microsoft.com/communities/newsgroups/default.mspx</a></p>
<p>It&#8217;s a shame, because I visit the <a href="http://www.microsoft.com/Businesssolutions/Community/Newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.axapta.programming&#038;lang=en&#038;cr=US">AX development group</a> using the web based news reader daily, and I will miss it. </p>
<p>Where will we go now? To the <a href="http://social.microsoft.com/Forums/en-US/category/dynamics/">Dynamics Forums</a>? </p>
]]></content:encoded>
			<wfw:commentRss>http://www.artofcreation.be/2010/05/10/microsoft-closing-ax-newsgroups/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Split big text files in smaller ones in X++</title>
		<link>http://www.artofcreation.be/2010/04/21/split-big-text-files-in-smaller-ones-in-x/</link>
		<comments>http://www.artofcreation.be/2010/04/21/split-big-text-files-in-smaller-ones-in-x/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 16:16:12 +0000</pubDate>
		<dc:creator>Klaas Deforche</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Job]]></category>
		<category><![CDATA[System.IO]]></category>

		<guid isPermaLink="false">http://www.artofcreation.be/?p=703</guid>
		<description><![CDATA[Below is a job I found useful many times, so don&#8217;t want to loose it. Nothing special, but maybe you&#8217;ll find it useful too. It splits an input text file into smaller files. As there is one comment line for every line of code (almost), I&#8217;m sure you&#8217;ll figure it out :-). static void KlForSplitFile&#40;Args [...]]]></description>
			<content:encoded><![CDATA[<p>Below is a job I found useful many times, so don&#8217;t want to loose it.<br />
Nothing special, but maybe you&#8217;ll find it useful too. </p>
<p>It splits an input text file into smaller files.<br />
As there is one comment line for every line of code (almost), I&#8217;m sure you&#8217;ll figure it out :-).</p>
<div class="codecolorer-container xpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">static</span> <span style="color: #0000ff;">void</span> KlForSplitFile<span style="color: #000000;">&#40;</span>Args _args<span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; #File<br />
&nbsp; &nbsp; AsciiIO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; inFile<span style="color: #00007f;">,</span> outFile;<br />
&nbsp; &nbsp; <span style="color: #0000ff;">container</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rec;<br />
&nbsp; &nbsp; <span style="color: #0000ff;">int</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cnt <span style="color: #00007f;">=</span> <span style="color: #000000;">0</span><span style="color: #00007f;">,</span> fileNum &nbsp; &nbsp;<span style="color: #00007f;">=</span> <span style="color: #000000;">0</span>;<br />
&nbsp; &nbsp; FileName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;outFileName;<br />
&nbsp; &nbsp; FileIOPermission &nbsp; &nbsp;filePermissionOrig<span style="color: #00007f;">,</span> outFilePermission;<br />
&nbsp; &nbsp; Set &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; permissionSet <span style="color: #00007f;">=</span> <span style="color: #0000ff;">new</span> set<span style="color: #000000;">&#40;</span>types<span style="color: #00007f;">::</span><span style="color: #0000ff;">Class</span><span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// settings begin</span><br />
&nbsp; &nbsp; <span style="color: #007f00;">// input file</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">str</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _inFileName <span style="color: #00007f;">=</span> @<span style="color: #ff0000;">&quot;C:<span style="color: #000000;">\t</span>emp<span style="color: #000000;">\t</span>estsplit<span style="color: #000000;">\t</span>estsplit.csv&quot;</span>;<br />
&nbsp; &nbsp; <span style="color: #007f00;">// max number of lines</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">int</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _maxrec <span style="color: #00007f;">=</span> <span style="color: #000000;">20000</span>;<br />
&nbsp; &nbsp; <span style="color: #007f00;">//settings end</span><br />
&nbsp; &nbsp; ;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">//</span><br />
&nbsp; &nbsp; <span style="color: #007f00;">// first loop to create the permission set</span><br />
&nbsp; &nbsp; <span style="color: #007f00;">//</span><br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// assert permission for read</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">new</span> FileIOPermission<span style="color: #000000;">&#40;</span>_inFileName<span style="color: #00007f;">,</span> #io_read<span style="color: #000000;">&#41;</span>.<span style="color: #000000;">assert</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// create new asciiIo for the file we are reading in</span><br />
&nbsp; &nbsp; inFile &nbsp;<span style="color: #00007f;">=</span> <span style="color: #0000ff;">new</span> AsciiIo<span style="color: #000000;">&#40;</span>_inFileName<span style="color: #00007f;">,</span>#io_read<span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// read file to check how many files will be created</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">while</span><span style="color: #000000;">&#40;</span>inFile.<span style="color: #000000;">read</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #000000;">&#40;</span>cnt <span style="color: #00007f;">==</span> _maxrec <span style="color: #00007f;">||</span> cnt <span style="color: #00007f;">==</span> <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007f00;">// 1 more file</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; filenum<span style="color: #00007f;">++</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007f00;">// create filename</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; outFileName <span style="color: #00007f;">=</span> <span style="color: #0000ff;">strfmt</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'%1_%2.csv'</span><span style="color: #00007f;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>_inFileName<span style="color: #00007f;">,</span><span style="color: #000000;">1</span><span style="color: #00007f;">,</span><span style="color: #0000ff;">strlen</span><span style="color: #000000;">&#40;</span>_inFileName<span style="color: #000000;">&#41;</span> <span style="color: #00007f;">-</span> <span style="color: #000000;">4</span><span style="color: #000000;">&#41;</span><span style="color: #00007f;">,</span> fileNum<span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007f00;">// create permission</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; outFilePermission <span style="color: #00007f;">=</span> <span style="color: #0000ff;">new</span> FileIOPermission<span style="color: #000000;">&#40;</span>outFileName<span style="color: #00007f;">,</span>#io_write<span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007f00;">// add permission to set</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; permissionset.<span style="color: #000000;">add</span><span style="color: #000000;">&#40;</span>outFilePermission<span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007f00;">// reset line counter</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cnt <span style="color: #00007f;">=</span> <span style="color: #000000;">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007f00;">// 1 more line</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; cnt<span style="color: #00007f;">++</span>;<br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// also add fileIn permission to set</span><br />
&nbsp; &nbsp; filePermissionOrig <span style="color: #00007f;">=</span> &nbsp;<span style="color: #0000ff;">new</span> FileIOPermission<span style="color: #000000;">&#40;</span>_inFileName<span style="color: #00007f;">,</span> #io_read<span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; permissionset.<span style="color: #000000;">add</span><span style="color: #000000;">&#40;</span>filePermissionOrig<span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #007f00;">// revert permission assertion</span><br />
&nbsp; &nbsp; CodeAccessPermission<span style="color: #00007f;">::</span><span style="color: #000000;">revertAssert</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// assert permissions for set</span><br />
&nbsp; &nbsp; CodeAccessPermission<span style="color: #00007f;">::</span><span style="color: #000000;">assertMultiple</span><span style="color: #000000;">&#40;</span>permissionset<span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">//</span><br />
&nbsp; &nbsp; <span style="color: #007f00;">// loop file again and split</span><br />
&nbsp; &nbsp; <span style="color: #007f00;">//</span><br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// reset counters</span><br />
&nbsp; &nbsp; fileNum <span style="color: #00007f;">=</span> <span style="color: #000000;">0</span>;<br />
&nbsp; &nbsp; cnt &nbsp; &nbsp; <span style="color: #00007f;">=</span> <span style="color: #000000;">0</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// create new asciiIo for the file we are reading in</span><br />
&nbsp; &nbsp; inFile &nbsp;<span style="color: #00007f;">=</span> <span style="color: #0000ff;">new</span> AsciiIo<span style="color: #000000;">&#40;</span>_inFileName<span style="color: #00007f;">,</span>#io_read<span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// read file to check how many files will be created</span><br />
&nbsp; &nbsp; <span style="color: #007f00;">// read ahead</span><br />
&nbsp; &nbsp; rec <span style="color: #00007f;">=</span> inFile.<span style="color: #000000;">read</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #0000ff;">while</span><span style="color: #000000;">&#40;</span>rec<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #000000;">&#40;</span>cnt <span style="color: #00007f;">==</span> _maxrec <span style="color: #00007f;">||</span> cnt <span style="color: #00007f;">==</span> <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007f00;">// 1 more file</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; filenum<span style="color: #00007f;">++</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007f00;">// create filename</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; outFileName <span style="color: #00007f;">=</span> <span style="color: #0000ff;">strfmt</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'%1_%2.csv'</span><span style="color: #00007f;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>_inFileName<span style="color: #00007f;">,</span><span style="color: #000000;">1</span><span style="color: #00007f;">,</span><span style="color: #0000ff;">strlen</span><span style="color: #000000;">&#40;</span>_inFileName<span style="color: #000000;">&#41;</span> <span style="color: #00007f;">-</span> <span style="color: #000000;">4</span><span style="color: #000000;">&#41;</span><span style="color: #00007f;">,</span> fileNum<span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; outFile <span style="color: #00007f;">=</span> <span style="color: #0000ff;">new</span> AsciiIO<span style="color: #000000;">&#40;</span>outFileName<span style="color: #00007f;">,</span>#io_write<span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007f00;">// reset line counter</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cnt <span style="color: #00007f;">=</span> <span style="color: #000000;">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007f00;">// 1 more line</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; cnt<span style="color: #00007f;">++</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007f00;">// write to split file</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; outFile.<span style="color: #000000;">writeExp</span><span style="color: #000000;">&#40;</span>rec<span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007f00;">// read next line</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; rec <span style="color: #00007f;">=</span> inFile.<span style="color: #000000;">read</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #007f00;">// revert permission assertion</span><br />
&nbsp; &nbsp; CodeAccessPermission<span style="color: #00007f;">::</span><span style="color: #000000;">revertAssert</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; info<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'done'</span><span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.artofcreation.be/2010/04/21/split-big-text-files-in-smaller-ones-in-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
