<?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>Doens.be &#187; Ax 4.0</title>
	<atom:link href="http://www.doens.be/tag/ax-4-0/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.doens.be</link>
	<description></description>
	<lastBuildDate>Sat, 07 Jan 2012 04:20:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Change the language at runtime</title>
		<link>http://www.doens.be/2011/11/change-the-language-at-runtime/</link>
		<comments>http://www.doens.be/2011/11/change-the-language-at-runtime/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 06:00:18 +0000</pubDate>
		<dc:creator>Jeroen Doens</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Ax 4.0]]></category>
		<category><![CDATA[Ax 5.0 (2009)]]></category>
		<category><![CDATA[Ax 6.0 (2012)]]></category>
		<category><![CDATA[Infolog]]></category>
		<category><![CDATA[Language]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[X++]]></category>

		<guid isPermaLink="false">http://www.doens.be/?p=979</guid>
		<description><![CDATA[Normally when you change your language you go to your user options, change your current language and the restart the client. This week I got the question if it was possible to do so in runtime. You can do so by just calling the infolog.language(str 7 _languageCode). All labels that you load after calling this [...]]]></description>
			<content:encoded><![CDATA[<p>Normally when you change your language you go to your user options, change your current language and the restart the client. This week I got the question if it was possible to do so in runtime. You can do so by just calling the <strong>infolog.language(<span style="color: #000080;">str</span> <span style="color: #ff0000;">7</span> _languageCode)</strong>. All labels that you load after calling this method will be translated to the new language.<span id="more-979"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">static</span> <span style="color: #0000ff;">void</span> JDO_ChangeLanguage<span style="color: #000000;">&#40;</span>Args _args<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    info<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;@SYS1&quot;</span><span style="color: #000000;">&#41;</span>;
    infolog.<span style="color: #000000;">language</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'nl-be'</span><span style="color: #000000;">&#41;</span>; <span style="color: #007f00;">// Change the language to nl-be</span>
    info<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;@SYS1&quot;</span><span style="color: #000000;">&#41;</span>;
    infolog.<span style="color: #000000;">language</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'fr-be'</span><span style="color: #000000;">&#41;</span>; <span style="color: #007f00;">// Change the language to fr-be</span>
    info<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;@SYS1&quot;</span><span style="color: #000000;">&#41;</span>;
    infolog.<span style="color: #000000;">language</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'it'</span><span style="color: #000000;">&#41;</span>; <span style="color: #007f00;">// Change the language to it</span>
    info<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;@SYS1&quot;</span><span style="color: #000000;">&#41;</span>;
    infolog.<span style="color: #000000;">language</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'de'</span><span style="color: #000000;">&#41;</span>; <span style="color: #007f00;">// Change the language to de</span>
    info<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;@SYS1&quot;</span><span style="color: #000000;">&#41;</span>;
    infolog.<span style="color: #000000;">language</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'en-us'</span><span style="color: #000000;">&#41;</span>; <span style="color: #007f00;">// Change the language to en-us</span>
    info<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;@SYS1&quot;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>And the result is:</p>
<p><img class="size-full wp-image-980 alignnone" title="infologLanguage" src="http://www.doens.be/wp-content/uploads/2011/11/infologLanguage.png" alt="" width="356" height="390" /></p>
<p><strong>Caution</strong>: When you use this function make sure you get the current language before you use this function, so you can change it back when you don&#8217;t need it any more.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doens.be/2011/11/change-the-language-at-runtime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amount in words</title>
		<link>http://www.doens.be/2011/11/amount-in-words/</link>
		<comments>http://www.doens.be/2011/11/amount-in-words/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 06:00:42 +0000</pubDate>
		<dc:creator>Jeroen Doens</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Ax 4.0]]></category>
		<category><![CDATA[Ax 5.0 (2009)]]></category>
		<category><![CDATA[Ax 6.0 (2012)]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[X++]]></category>

		<guid isPermaLink="false">http://www.doens.be/?p=971</guid>
		<description><![CDATA[This week one of my customers asked me to place the amount in words on a invoice. I couldn&#8217;t believe that sush function wasn&#8217;t availible in standard Ax. After some research I found that the Global-class contains the following methods: static TempStr numeralsToTxt(real _num) static TempStr numeralsToTxt_EN(real _num) static TempStr numeralsToTxt_ES(real _num) static TempStr numeralsToTxt_FR(real [...]]]></description>
			<content:encoded><![CDATA[<p>This week one of my customers asked me to place the amount in words on a invoice. I couldn&#8217;t believe that sush function wasn&#8217;t availible in standard Ax. After some research I found that the <strong>Global-class</strong> contains the following methods:</p>
<ul>
<li><span style="color: #000080;">static TempStr</span> <strong>numeralsToTxt</strong>(<span style="color: #000080;">real</span> _num)</li>
<li><span style="color: #000080;">static TempStr</span> <strong>numeralsToTxt_EN</strong>(<span style="color: #000080;">real</span> _num)</li>
<li><span style="color: #000080;">static TempStr</span> <strong>numeralsToTxt_ES</strong>(<span style="color: #000080;">real</span> _num)</li>
<li><span style="color: #000080;">static TempStr</span> <strong>numeralsToTxt_FR</strong>(<span style="color: #000080;">real</span> _num)</li>
<li><span style="color: #000080;">static TempStr</span> <strong>numeralsToTxt_NL</strong>(<span style="color: #000080;">real</span> _num)</li>
</ul>
<p><span id="more-971"></span>So you can just use these methods like this:</p>

<div class="wp_syntax"><div class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">static</span> <span style="color: #0000ff;">void</span> JDO_AmountInWords<span style="color: #000000;">&#40;</span>Args _args<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    info<span style="color: #000000;">&#40;</span>numeralsToTxt<span style="color: #000000;">&#40;</span><span style="color: #000000;">123456789.12</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>And you get the following result:</p>
<p><img class="size-full wp-image-973 alignnone" title="numeralsToTxt" src="http://www.doens.be/wp-content/uploads/2011/11/numeralsToTxt.png" alt="" width="356" height="323" /></p>
<p>I know these methods aren&#8217;t perfect, but they can be a start and save you a lot of programming time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doens.be/2011/11/amount-in-words/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Records with RecId 101090</title>
		<link>http://www.doens.be/2010/08/records-with-recid-101090/</link>
		<comments>http://www.doens.be/2010/08/records-with-recid-101090/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 05:00:37 +0000</pubDate>
		<dc:creator>Jeroen Doens</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Ax 4.0]]></category>
		<category><![CDATA[Ax 5.0 (2009)]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[X++]]></category>

		<guid isPermaLink="false">http://www.doens.be/?p=643</guid>
		<description><![CDATA[I was using the postload method of the HRMBenefitType-table to fill the description-field with language-sensitive description (from LanguageTxt). This works fine when I view the record, but not when I use a lookup. I&#8217;ve put a break-point on my postload method and noticed the recId (this.recid of the HRMBenefitType table). This is always the 101090. [...]]]></description>
			<content:encoded><![CDATA[<p>I was using the postload method of the HRMBenefitType-table to fill the description-field with language-sensitive description (from LanguageTxt). This works fine when I view the record, but not when I use a lookup.</p>
<p>I&#8217;ve put a break-point on my postload method and noticed the <strong>recId</strong> (this.recid of the HRMBenefitType table). This is always the <strong>101090</strong>. When I check this in the tablebrowser, this does not match the actual RecId valule.<br />
I checked the SQL-trace-log and noticed the following instruction:</p>
<blockquote><p>SELECT A.HRMBENEFITTYPEID,A.DESCRIPTION,A.RECVERSION,101090 FROM HRMBENEFITTYPE A WHERE (DATAAREAID=?) ORDER BY A.DATAAREAID,A.HRMBENEFITTYPEID OPTION(FAST 1)</p></blockquote>
<p><strong>The solution</strong> to this problem is simple. Just change the <strong>CacheLookup</strong> property to <strong>EntireTable</strong> and the strange behaviour of the RecId-field stops.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doens.be/2010/08/records-with-recid-101090/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>System tables &#8211; part1</title>
		<link>http://www.doens.be/2010/05/system-tables-part1-a-d/</link>
		<comments>http://www.doens.be/2010/05/system-tables-part1-a-d/#comments</comments>
		<pubDate>Mon, 03 May 2010 05:00:57 +0000</pubDate>
		<dc:creator>Jeroen Doens</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[AOT]]></category>
		<category><![CDATA[Ax 4.0]]></category>
		<category><![CDATA[Ax 5.0 (2009)]]></category>
		<category><![CDATA[Tables]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.doens.be/?p=505</guid>
		<description><![CDATA[In this post I will talk about some Ax kernel tables that are automatically created after the setup at the first run of Ax. They are typically company independent (no DataAreaId) and contain some valuable information about AX. You can find the tables I wil discuss under the AOT &#8211;&#62; System Documentation &#8211;&#62; Tables. AccessRightsList [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I will talk about some Ax kernel tables that are automatically created after the setup at the first run of Ax. They are typically company independent (no DataAreaId) and contain some valuable information about AX.</p>
<p>You can find the tables I wil discuss under the AOT &#8211;&gt; System Documentation &#8211;&gt; Tables.</p>
<p style="text-align: center;"><a href="http://www.doens.be/wp-content/uploads/2010/04/aot_SystemDocumentation.png"><img class="size-full wp-image-506  aligncenter" title="aot_SystemDocumentation" src="http://www.doens.be/wp-content/uploads/2010/04/aot_SystemDocumentation.png" alt="" width="257" height="505" /></a></p>
<ul>
<li>AccessRightsList : This table is used to manage the authorization of the usergroups in Ax (Be carefull). The most important fields in this table are:
<ul>
<li>GroupId : Usergroup (UserGroupInfo)</li>
<li>RecordType : Type of accessRights Table, securityKey</li>
<li>Id : Internal Id of the object on witch access rights have been defined</li>
<li>AccessType: Granted access rights (No Access, Read, Change, Add, Full Control)</li>
<li>&#8230;</li>
</ul>
</li>
<li>CompanyDomainList : This table contains  relation between companies and domains.</li>
<li>Common : The is the table that describes all other tables. It conains some important fields that return in all other tables. For example RecId, TableId, CreatedDateTime, &#8230;</li>
<li>DataArea : This table contains data about created companies.<br />
Important fields:</p>
<ul>
<li>Id : Company Id</li>
<li>Name</li>
<li>IsVirtual : Defines if the company is real (0) or Virtual (1). You often use this while looping trough companies with changecompany.</li>
<li>&#8230;</li>
</ul>
</li>
<li>DataBaseLog : This table contains data about which tables and  events to log.</li>
<li>DomainInfo : Table that contains info about the domains you have defined.</li>
</ul>
<p>It is not easy to find info about these tables, but I hop this helps you all a bit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doens.be/2010/05/system-tables-part1-a-d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Batch job performance boost</title>
		<link>http://www.doens.be/2010/04/batch-job-performance-boost/</link>
		<comments>http://www.doens.be/2010/04/batch-job-performance-boost/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 05:00:16 +0000</pubDate>
		<dc:creator>Jeroen Doens</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Ax 4.0]]></category>
		<category><![CDATA[Ax 5.0 (2009)]]></category>
		<category><![CDATA[Ax 6.0 (2012)]]></category>
		<category><![CDATA[Class]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[RunBaseBatch]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[X++]]></category>

		<guid isPermaLink="false">http://www.doens.be/?p=494</guid>
		<description><![CDATA[Did you ever have trouble with the performance of your batch-job? Well maybe this small trick can shorten the time your batch runs. The big idea: Try to split up your gigantic batch in smaller pieces. Launch a batchjob that produces many smaller batchjobs (tasks) that can handle a subset of the data you need to [...]]]></description>
			<content:encoded><![CDATA[<p>Did you ever have trouble with the performance of your batch-job? Well maybe this small trick can shorten the time your batch runs.</p>
<p><strong>The big idea</strong>: Try to split up your gigantic batch in smaller pieces. Launch a batchjob that produces many smaller batchjobs (tasks) that can handle a subset of the data you need to process. For example you can create a batch that creates a batch with sub-tasks for each company.</p>
<p>How do you plan a batch from code?</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;">BatchHeader batHeader;
BatchInfo batInfo;
TstRunBase rbbTask;
;
rbbTask <span style="color: #00007f;">=</span> TstMyBatch<span style="color: #00007f;">::</span><span style="color: #000000;">construct</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
batInfo <span style="color: #00007f;">=</span> rbbTask.<span style="color: #000000;">batchInfo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
batInfo.<span style="color: #000000;">parmCaption</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;MyBatch&quot;</span><span style="color: #000000;">&#41;</span>;
batInfo.<span style="color: #000000;">parmGroupId</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000;">&#41;</span>;
batHeader <span style="color: #00007f;">=</span> BatchHeader<span style="color: #00007f;">::</span><span style="color: #000000;">construct</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
batHeader.<span style="color: #000000;">addTask</span><span style="color: #000000;">&#40;</span>rbbTask<span style="color: #000000;">&#41;</span>;
batHeader.<span style="color: #000000;">save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
info<span style="color: #000000;">&#40;</span>batInfo.<span style="color: #000000;">parmCaption</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;</pre></td></tr></table></div>

<p>You can download a quick example I made. This is a job you can schedule and it will produce a new Batch job with a task for each company when you don&#8217;t select a company while shedualing (<a href="http://www.doens.be/wp-content/uploads/2010/04/Class_TstRunBase.xpo" target="_blank">Class_TstRunBase.xpo</a>). I hope this can help you.</p>
<p>Schedule the batch:<a href="http://www.doens.be/wp-content/uploads/2010/04/batchjob_schedule.png"><br />
<img class="size-full wp-image-496 alignnone" title="batchjob_schedule" src="http://www.doens.be/wp-content/uploads/2010/04/batchjob_schedule.png" alt="" width="295" height="160" /></a></p>
<p>The result:<br />
<a href="http://www.doens.be/wp-content/uploads/2010/04/batchjob_overview.png"><img class="alignnone size-full wp-image-497" title="batchjob_overview" src="http://www.doens.be/wp-content/uploads/2010/04/batchjob_overview.png" alt="" width="492" height="244" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.doens.be/2010/04/batch-job-performance-boost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Expressions in query ranges &#8211; limitations</title>
		<link>http://www.doens.be/2010/04/expressions-in-query-ranges-limitations/</link>
		<comments>http://www.doens.be/2010/04/expressions-in-query-ranges-limitations/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 05:00:50 +0000</pubDate>
		<dc:creator>Jeroen Doens</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Ax 4.0]]></category>
		<category><![CDATA[Ax 5.0 (2009)]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[Query]]></category>
		<category><![CDATA[QueryRun]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[X++]]></category>

		<guid isPermaLink="false">http://www.doens.be/?p=482</guid>
		<description><![CDATA[When you want to construct a query-object that contains OR-conditions, you can construct something like this: 1 2 3 4 5 6 queryBuildRange.value&#40;strFmt&#40;'((%1 == %2) &#124;&#124; ((%1 == %3) &#38;&#38; (%4 == &#34;%5&#34;)))', fieldStr&#40;InventTable, ItemType&#41;, any2int&#40;ItemType::Service&#41;, any2int&#40;ItemType::Item&#41;, fieldStr&#40;InventTable, ProjCategoryId&#41;, queryValue&#40;&#34;Spares&#34;&#41;&#41;&#41;; (you can find more info on Axaptapedia: Expressions in query ranges) Now there is a [...]]]></description>
			<content:encoded><![CDATA[<p>When you want to construct a query-object that contains OR-conditions, you can construct something like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;">queryBuildRange.<span style="color: #000000;">value</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">strFmt</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'((%1 == %2) || ((%1 == %3) &amp;&amp; (%4 == &quot;%5&quot;)))'</span><span style="color: #00007f;">,</span>
                    <span style="color: #0000ff;">fieldStr</span><span style="color: #000000;">&#40;</span>InventTable<span style="color: #00007f;">,</span> ItemType<span style="color: #000000;">&#41;</span><span style="color: #00007f;">,</span>
                    <span style="color: #0000ff;">any2int</span><span style="color: #000000;">&#40;</span>ItemType<span style="color: #00007f;">::</span><span style="color: #000000;">Service</span><span style="color: #000000;">&#41;</span><span style="color: #00007f;">,</span>
                    <span style="color: #0000ff;">any2int</span><span style="color: #000000;">&#40;</span>ItemType<span style="color: #00007f;">::</span><span style="color: #000000;">Item</span><span style="color: #000000;">&#41;</span><span style="color: #00007f;">,</span>
                    <span style="color: #0000ff;">fieldStr</span><span style="color: #000000;">&#40;</span>InventTable<span style="color: #00007f;">,</span> ProjCategoryId<span style="color: #000000;">&#41;</span><span style="color: #00007f;">,</span>
                    queryValue<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;Spares&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;</pre></td></tr></table></div>

<p>(you can find more info on <a href="http://www.axaptapedia.com/Expressions_in_query_ranges">Axaptapedia: Expressions in query ranges</a>)</p>
<p>Now there is a limitation to this way of working. When the generated string in the queryBuildRange.value is longer than 250 characters (the length of the range EDT), Ax cuts the generated string off when you open the &#8216;modify query&#8217; dialog. I have tried to enlarging the EDT, but is not a good solution. The error does not occure when you open the &#8216;modify query&#8217; dialog, but it occures when you close it.<br />
A small (but limited) work-around could be to make the name of the datasources on the form/report where you want to apply this trick smaller. I hope to find a better solution, but this does the trick for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doens.be/2010/04/expressions-in-query-ranges-limitations/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Test if a configuration key is enabled in X++ code</title>
		<link>http://www.doens.be/2010/03/if-a-configuration-key-is-enabled-in-x-code/</link>
		<comments>http://www.doens.be/2010/03/if-a-configuration-key-is-enabled-in-x-code/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 07:00:20 +0000</pubDate>
		<dc:creator>Jeroen Doens</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Ax 4.0]]></category>
		<category><![CDATA[Ax 5.0 (2009)]]></category>
		<category><![CDATA[Configuration key]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[X++]]></category>

		<guid isPermaLink="false">http://www.doens.be/?p=419</guid>
		<description><![CDATA[How do you execute code when a Configuration key is enabled? It is pritty easy. Ax x++ has a build-in function &#8216;isConfigurationKeyEnabled&#8217;, witch you can use to check a configuration key. Small example: if &#40;isConfigurationKeyEnabled&#40;configurationkeynum&#40;AIF&#41;&#41;&#41; &#123; // Do something... &#125;]]></description>
			<content:encoded><![CDATA[<p>How do you execute code when a Configuration key is enabled?<br />
It is pritty easy. Ax x++ has a build-in function &#8216;isConfigurationKeyEnabled&#8217;, witch you can use to check a configuration key.</p>
<p>Small example:</p>

<div class="wp_syntax"><div class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">if</span> <span style="color: #000000;">&#40;</span>isConfigurationKeyEnabled<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">configurationkeynum</span><span style="color: #000000;">&#40;</span>AIF<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #007f00;">// Do something...</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.doens.be/2010/03/if-a-configuration-key-is-enabled-in-x-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>List of mandatory fields on a table</title>
		<link>http://www.doens.be/2010/02/list-of-mandatory-fields-on-a-table/</link>
		<comments>http://www.doens.be/2010/02/list-of-mandatory-fields-on-a-table/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 07:00:28 +0000</pubDate>
		<dc:creator>Jeroen Doens</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[AOT]]></category>
		<category><![CDATA[Ax 4.0]]></category>
		<category><![CDATA[Ax 5.0 (2009)]]></category>
		<category><![CDATA[DictTable]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[X++]]></category>

		<guid isPermaLink="false">http://www.doens.be/?p=369</guid>
		<description><![CDATA[When you want a list of all the mandatory field on table X, yould check all the properties on the table fields, or you could be lazy and write a small job that does the trick for you. Just replace TableId with your tablenum. 1 2 3 4 5 6 7 8 9 10 11 [...]]]></description>
			<content:encoded><![CDATA[<p>When you want a list of all the mandatory field on table X, yould check all the properties on the table fields, or you could be lazy and write a small job that does the trick for you. Just replace TableId with your tablenum.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">static</span> <span style="color: #0000ff;">void</span> CheckMandatoryFieldsOnTable<span style="color: #000000;">&#40;</span>Args _args<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    DictTable dictTable;
    DictField dictField;
    <span style="color: #0000ff;">int</span> i;
    TableId tableId <span style="color: #00007f;">=</span> <span style="color: #0000ff;">tablenum</span><span style="color: #000000;">&#40;</span>custtable<span style="color: #000000;">&#41;</span>;
    ;
    dictTable <span style="color: #00007f;">=</span> <span style="color: #0000ff;">new</span> DictTable<span style="color: #000000;">&#40;</span>tableId<span style="color: #000000;">&#41;</span>;
    <span style="color: #0000ff;">for</span> <span style="color: #000000;">&#40;</span>i<span style="color: #00007f;">=</span><span style="color: #000000;">1</span> ; i<span style="color: #00007f;">&lt;=</span>dictTable.<span style="color: #000000;">fieldCnt</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ; i<span style="color: #00007f;">++</span><span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        dictField <span style="color: #00007f;">=</span> <span style="color: #0000ff;">new</span> DictField<span style="color: #000000;">&#40;</span>tableId<span style="color: #00007f;">,</span> dictTable.<span style="color: #000000;">fieldCnt2Id</span><span style="color: #000000;">&#40;</span>i<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
        <span style="color: #0000ff;">if</span> <span style="color: #000000;">&#40;</span>dictField.<span style="color: #000000;">mandatory</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            info<span style="color: #000000;">&#40;</span>dictField.<span style="color: #000000;">name</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.doens.be/2010/02/list-of-mandatory-fields-on-a-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code Editor &#8211; shortcuts</title>
		<link>http://www.doens.be/2010/02/code-editor-shortcuts/</link>
		<comments>http://www.doens.be/2010/02/code-editor-shortcuts/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 07:00:20 +0000</pubDate>
		<dc:creator>Jeroen Doens</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Ax 4.0]]></category>
		<category><![CDATA[Ax 5.0 (2009)]]></category>
		<category><![CDATA[Code Editor]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[X++]]></category>

		<guid isPermaLink="false">http://www.doens.be/?p=362</guid>
		<description><![CDATA[Underneed you find the list of shortcuts I use most in Microsoft Dynamics Ax while developing. General (shortcuts I also use outside AX) CTRL + S : Save. CTRL + C : Copy text to clipboard. CTRL + X : Cut text to clipboard. CTRL + V : Past text from clipboard. CTRL + A : [...]]]></description>
			<content:encoded><![CDATA[<p>Underneed you find the list of shortcuts I use most in Microsoft Dynamics Ax while developing.</p>
<ul>
<li>General (shortcuts I also use outside AX)
<ul>
<li>CTRL + S : Save.</li>
<li>CTRL + C : Copy text to clipboard.</li>
<li>CTRL + X : Cut text to clipboard.</li>
<li>CTRL + V : Past text from clipboard.</li>
<li>CTRL + A : Select all.</li>
<li>CTRL + LEFT / RIGHT ARROW : Next/Previous word.</li>
<li>CTRL + SHIFT + LEFT / RIGHT ARROW : Select one word to the left/right.</li>
<li>CTRL + HOME / END : Go to begin/end of the editor.</li>
<li>SHIFT + HOME / END : Select text from the cursor to the start/end.</li>
<li>SHIFT + PAGE-UP / PAGE-DOWN : Select the previous/next page. of the line.</li>
<li>TAB / SHIFT + TAB : Indent Selection / Remove Indent Selection.</li>
<li>CTRL + BACKSPACE : Remove previous word.</li>
<li>CTRL + F : Find.</li>
<li>F3 : Find Next.</li>
<li>CTRL + Z / Y : Undo / Redo.</li>
<li>CTRL (+ SHIFT) + TAB : Next/Previous tab-page.</li>
</ul>
</li>
<li>Ax specific
<ul>
<li>Current Line in the Code Editor
<ul>
<li>ALT + L : Select current line.</li>
<li>CTRL + L : Remove current line.</li>
</ul>
</li>
<li>Breakpoints
<ul>
<li>F9 : Insert / Remove breakpoint.</li>
<li>SHIFT + F9 : Show all breakpoints.</li>
<li>CTRL +F9 : Enable / Disable breakpoint.</li>
<li>CTRL + SHIFT + F9 : Remove all breakpoints.</li>
</ul>
</li>
<li>Compile / Run
<ul>
<li>F5 : run / execute current Job / Class / Form</li>
<li>CTRL + BREAK : Stop execution.</li>
</ul>
</li>
<li>Lookup / More Info
<ul>
<li>CTRL + ALT + SPACE : Lookup label.</li>
<li>CTRL + SHIFT + SPACE : Lookup definition (go to the method).</li>
<li>CTRL + SPACE : Show syntax information.</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>And there are more shortcuts. You can find them on <a href="http://msdn.microsoft.com/en-us/library/aa865357.aspx" target="_blank">MSDN</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doens.be/2010/02/code-editor-shortcuts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working with numbersequences &#8211; On forms</title>
		<link>http://www.doens.be/2010/02/working-with-numbersequences-on-forms/</link>
		<comments>http://www.doens.be/2010/02/working-with-numbersequences-on-forms/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 17:00:59 +0000</pubDate>
		<dc:creator>Jeroen Doens</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Ax 4.0]]></category>
		<category><![CDATA[Ax 5.0 (2009)]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[Number Sequence]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[X++]]></category>

		<guid isPermaLink="false">http://www.doens.be/?p=358</guid>
		<description><![CDATA[When you want to implement NumberSequences in a Ax form (new numbersequence when you create a record etc.) you can just implement the ‘numberSeqFormHandler’. Step-by-step: Define a object of the type &#8216;NumberSeqFormHandler&#8216; in the ClassDeclaration of the form 1 2 3 4 public class FormRun extends ObjectRun &#123;     NumberSeqFormHandler            numberSeqFormHandler; &#125; Create a new [...]]]></description>
			<content:encoded><![CDATA[<p>When you want to implement NumberSequences in a Ax form (new numbersequence when you create a record etc.) you can just implement the ‘<a href="http://msdn.microsoft.com/en-us/library/aa632953.aspx"><em>numberSeqFormHandler</em></a>’.</p>
<p>Step-by-step:<span id="more-358"></span></p>
<ul>
<li>Define a object of the type &#8216;<em>NumberSeqFormHandler</em>&#8216; in the <em>ClassDeclaration</em> of the form

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">class</span> FormRun <span style="color: #0000ff;">extends</span> ObjectRun
<span style="color: #000000;">&#123;</span>
    NumberSeqFormHandler            numberSeqFormHandler;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

</li>
<li>Create a new method on your form that create a new instance of the ‘<em>numberSeqFormHandler’</em> object or creates a new object when it isn’t instanciated.

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;">NumberSeqFormHandler numberSeqFormHandler<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    ;
    <span style="color: #0000ff;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #00007f;">!</span>numberSeqFormHandler<span style="color: #000000;">&#41;</span>
        numberSeqFormHandler <span style="color: #00007f;">=</span> NumberSeqFormHandler<span style="color: #00007f;">::</span><span style="color: #000000;">newForm</span><span style="color: #000000;">&#40;</span>TestParameters<span style="color: #00007f;">::</span><span style="color: #000000;">numRefTEST</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #000000;">NumberSequence</span><span style="color: #00007f;">,</span>
                                                             element<span style="color: #00007f;">,</span>
                                                             TestTable_DS<span style="color: #00007f;">,</span>
                                                             <span style="color: #0000ff;">fieldnum</span><span style="color: #000000;">&#40;</span>TestTable<span style="color: #00007f;">,</span>TEST<span style="color: #000000;">&#41;</span>
                                                            <span style="color: #000000;">&#41;</span>;
    <span style="color: #0000ff;">return</span> numberSeqFormHandler;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

</li>
<li>Complete some of the existing methods with the correct method of the &#8216;<em>numberSeqFormHandler</em>&#8216; object:
<ul>
<li>Table : Create() &#8211;> The user creates a new record in the data source.

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">void</span> create<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">boolean</span> _append <span style="color: #00007f;">=</span> <span style="color: #0000ff;">false</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    ;
    element.<span style="color: #000000;">numberSeqFormHandler</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #000000;">formMethodDataSourceCreatePre</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
    <span style="color: #0000ff;">super</span><span style="color: #000000;">&#40;</span>_append<span style="color: #000000;">&#41;</span>;
    element.<span style="color: #000000;">numberSeqFormHandler</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #000000;">formMethodDataSourceCreate</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

</li>
<li>Table : Delete() &#8211;> The user deletes a record in the data source.

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">void</span> delete<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    ;
    element.<span style="color: #000000;">numberSeqFormHandler</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #000000;">formMethodDataSourceDelete</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
    <span style="color: #0000ff;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

</li>
<li>Table : Write() &#8211;> The user inserts a new record or updates an existing one.

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">void</span> write<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    ;
    <span style="color: #0000ff;">ttsbegin</span>;
    <span style="color: #0000ff;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
    element.<span style="color: #000000;">numberSeqFormHandler</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #000000;">formMethodDataSourceWrite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
    <span style="color: #0000ff;">ttscommit</span>;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

</li>
<li>Table : validatWrite() &#8211;> new or updated record is to be written.

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">boolean</span> validateWrite<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0000ff;">boolean</span> ret;
    ;
    ret <span style="color: #00007f;">=</span> <span style="color: #0000ff;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
    ret <span style="color: #00007f;">=</span> element.<span style="color: #000000;">numberSeqFormHandler</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #000000;">formMethodDataSourceValidateWrite</span><span style="color: #000000;">&#40;</span>ret<span style="color: #000000;">&#41;</span> <span style="color: #00007f;">&amp;</span>amp;<span style="color: #00007f;">&amp;</span>amp; ret;
    <span style="color: #0000ff;">return</span> ret;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

</li>
<li>Table : linkActive() à The user selects a new record in a form that has a data source linked to another data source.

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">void</span> linkActive<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    ;
    element.<span style="color: #000000;">numberSeqFormHandler</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #000000;">formMethodDataSourceLinkActive</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
    <span style="color: #0000ff;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

</li>
<li>Close() &#8211;> The form is closed.

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">void</span> close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    ;
    <span style="color: #0000ff;">if</span> <span style="color: #000000;">&#40;</span>numberSeqFormHandler<span style="color: #000000;">&#41;</span>
        numberSeqFormHandler.<span style="color: #000000;">formMethodClose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
    <span style="color: #0000ff;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.doens.be/2010/02/working-with-numbersequences-on-forms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

