<?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; Number Sequence</title>
	<atom:link href="http://www.doens.be/tag/numbersequence/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>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>
		<item>
		<title>Working with numbersequences – Keep In Mind</title>
		<link>http://www.doens.be/2010/02/working-with-numbersequences-%e2%80%93-keep-in-mind/</link>
		<comments>http://www.doens.be/2010/02/working-with-numbersequences-%e2%80%93-keep-in-mind/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 17:00:54 +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[Best Practice]]></category>
		<category><![CDATA[Number Sequence]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.doens.be/?p=349</guid>
		<description><![CDATA[When you are using a Number Sequence, keep in mind that a Continuous Number Sequence is slower than a non-continuous. The reason is that the system creates a record in the table NumberSequenceList (with the status Active) and cleans it up later during TTSCOMMIT. Performance tip: You can improve the performance of a process that creates many [...]]]></description>
			<content:encoded><![CDATA[<p>When you are using a <a href="http://www.doens.be/tag/numbersequence/">Number Sequence</a>, keep in mind that a Continuous Number Sequence is slower than a non-continuous. The reason is that the system creates a record in the table NumberSequenceList (with the status Active) and cleans it up later during TTSCOMMIT.</p>
<p><strong>Performance tip:</strong> You can improve the performance of a process that creates many numbers of one Number Sequence by using number pre-allocation. This loads a set of numbers into the memory and provides faster access. You can do this by using the NumberSeqGlobal, witch means that once it is instantiated, it is available until the session is closed. This function is only available for non-continuous Number Sequences. The numbers can only be retrieved from the cache by calling the getNumInternal() method in the NumberSeq_Fast class.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doens.be/2010/02/working-with-numbersequences-%e2%80%93-keep-in-mind/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working with numbersequences &#8211; New Module</title>
		<link>http://www.doens.be/2010/02/working-with-numbersequences-new-module/</link>
		<comments>http://www.doens.be/2010/02/working-with-numbersequences-new-module/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 17:30:28 +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[Data Types]]></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=323</guid>
		<description><![CDATA[In a previous post I explained how to create a new Number Sequence in a existing module (Working with numbersequences – new NumberSequence). In this post I will explain how you can create a new Number Sequence-module. I will create a new module called TEST (lack of inspiration). Step-By-Step: First of all extend the existing [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous post I explained how to create a new Number Sequence in a existing module (<a href="http://www.doens.be/2009/05/working-with-numbersequences-new-numbersequence/" target="_self"><em>Working with numbersequences – new NumberSequence</em></a>). In this post I will explain how you can create a new Number Sequence-module.<br />
I will create a new module called TEST (lack of inspiration).</p>
<p>Step-By-Step:<span id="more-323"></span></p>
<ul>
<li>First of all extend the existing Enum &#8216;NumberSeqModule&#8217; with a new value &#8216;TEST&#8217; and enter the name of the module in the Label-property<br />
<a href="http://www.doens.be/wp-content/uploads/2010/02/NumberSequence_Enum.jpg" target="_blank"><img class="alignnone size-full wp-image-324" title="NumberSequence_Enum" src="http://www.doens.be/wp-content/uploads/2010/02/NumberSequence_Enum.jpg" alt="" width="121" height="450" /></a></li>
<li>create a new class called &#8216;<em>NumberSeqReference_TEST</em>&#8216; and that extends from &#8216;<em>NumberSeqReference</em>&#8216;.</li>
<li>Add a static method called &#8216;numberSeqModule&#8217; and return the new value of the Enum.

<div class="wp_syntax"><div class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">static</span> NumberSeqModule numberSeqModule<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0000ff;">return</span> NumberSeqModule<span style="color: #00007f;">::</span><span style="color: #000000;">TEST</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

</li>
<li>Override the Method loadModule and enter the necessary code for all the Number Sequences in your new module.

<div class="wp_syntax"><div class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">protected</span> <span style="color: #0000ff;">void</span> loadModule<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    NumberSequenceReference numRef;
    ;
    <span style="color: #007f00; font-style: italic;">/* TEST */</span>
    numRef.<span style="color: #000000;">DataTypeId</span>               <span style="color: #00007f;">=</span> typeId2ExtendedTypeId<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">typeid</span><span style="color: #000000;">&#40;</span>TEST<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
    numRef.<span style="color: #000000;">ReferenceHelp</span>            <span style="color: #00007f;">=</span> <span style="color: #0000ff;">literalstr</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;@SYS31561&quot;</span><span style="color: #000000;">&#41;</span>;
    numRef.<span style="color: #000000;">WizardContinuous</span>         <span style="color: #00007f;">=</span> <span style="color: #0000ff;">false</span>;
    numRef.<span style="color: #000000;">WizardManual</span>             <span style="color: #00007f;">=</span> NoYes<span style="color: #00007f;">::</span><span style="color: #000000;">No</span>;
    numRef.<span style="color: #000000;">WizardAllowChangeDown</span>    <span style="color: #00007f;">=</span> NoYes<span style="color: #00007f;">::</span><span style="color: #000000;">No</span>;
    numRef.<span style="color: #000000;">WizardAllowChangeUp</span>      <span style="color: #00007f;">=</span> NoYes<span style="color: #00007f;">::</span><span style="color: #000000;">No</span>;
    numRef.<span style="color: #000000;">WizardHighest</span>            <span style="color: #00007f;">=</span> <span style="color: #000000;">999999</span>;
    numRef.<span style="color: #000000;">SortField</span>                <span style="color: #00007f;">=</span> <span style="color: #000000;">1</span>;
&nbsp;
    this.<span style="color: #000000;">create</span><span style="color: #000000;">&#40;</span>numRef<span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

</li>
<li>In the class NumberSeqReference, you have to add some new lines so the system recognizes your new module. Complete the method construct &amp; moduleList.<br />
<a href="http://www.doens.be/wp-content/uploads/2010/02/NumberSequence_NumberSeqReference_construct2.jpg" target="_blank"><img class="alignnone size-full wp-image-333" title="NumberSequence_NumberSeqReference_construct2" src="http://www.doens.be/wp-content/uploads/2010/02/NumberSequence_NumberSeqReference_construct2.jpg" alt="" width="450" height="171" /></a><br />
<a href="http://www.doens.be/wp-content/uploads/2010/02/NumberSequence_NumberSeqReference_moduleList2.jpg" target="_blank"><img class="alignnone size-full wp-image-334" title="NumberSequence_NumberSeqReference_moduleList2" src="http://www.doens.be/wp-content/uploads/2010/02/NumberSequence_NumberSeqReference_moduleList2.jpg" alt="" width="450" height="171" /></a></li>
<li>Open the NumberSequence-form under BASIC &#8211; SETUP &#8211; NUMBER SEQUENCES &#8211; NUMBER SEQUENCES<br />
<a href="http://www.doens.be/wp-content/uploads/2010/02/NumberSequence_NumberSequence_form_01.jpg" target="_blank"><img class="alignnone size-full wp-image-327" title="NumberSequence_NumberSequence_form_01" src="http://www.doens.be/wp-content/uploads/2010/02/NumberSequence_NumberSequence_form_01.jpg" alt="" width="177" height="250" /></a></li>
<li>Open the Number Sequence-wizard<br />
<a href="http://www.doens.be/wp-content/uploads/2010/02/NumberSequence_NumberSequence_form_02_wizard.jpg" target="_blank"><img class="alignnone size-full wp-image-328" title="NumberSequence_NumberSequence_form_02_wizard" src="http://www.doens.be/wp-content/uploads/2010/02/NumberSequence_NumberSequence_form_02_wizard.jpg" alt="" width="450" height="267" /></a></li>
<li>Follow all the steps of the wizard and finish<br />
<a href="http://www.doens.be/wp-content/uploads/2010/02/NumberSequence_NumberSequence_wizard_01.jpg" target="_blank"><img class="alignnone size-full wp-image-330" title="NumberSequence_NumberSequence_wizard_01" src="http://www.doens.be/wp-content/uploads/2010/02/NumberSequence_NumberSequence_wizard_01.jpg" alt="" width="350" height="387" /></a><br />
 <a href="http://www.doens.be/wp-content/uploads/2010/02/NumberSequence_NumberSequence_wizard_03.jpg" target="_blank"><img class="alignnone size-full wp-image-332" title="NumberSequence_NumberSequence_wizard_03" src="http://www.doens.be/wp-content/uploads/2010/02/NumberSequence_NumberSequence_wizard_03.jpg" alt="" width="450" height="302" /></a><br />
<a href="http://www.doens.be/wp-content/uploads/2010/02/NumberSequence_NumberSequence_wizard_02.jpg" target="_blank"><img class="alignnone size-full wp-image-331" title="NumberSequence_NumberSequence_wizard_02" src="http://www.doens.be/wp-content/uploads/2010/02/NumberSequence_NumberSequence_wizard_02.jpg" alt="" width="450" height="302" /></a></li>
<li>See how the new Number Sequence in the Number Sequence-form<br />
<a href="http://www.doens.be/wp-content/uploads/2010/02/NumberSequence_NumberSequence_form_03_wizard.jpg" target="_blank"><img class="alignnone size-full wp-image-329" title="NumberSequence_NumberSequence_form_03_wizard" src="http://www.doens.be/wp-content/uploads/2010/02/NumberSequence_NumberSequence_form_03_wizard.jpg" alt="" width="450" height="267" /></a></li>
</ul>
<p>From now on you can use your new Numbersequence and the module.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doens.be/2010/02/working-with-numbersequences-new-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working with numbersequences – new NumberSequence</title>
		<link>http://www.doens.be/2009/05/working-with-numbersequences-new-numbersequence/</link>
		<comments>http://www.doens.be/2009/05/working-with-numbersequences-new-numbersequence/#comments</comments>
		<pubDate>Tue, 05 May 2009 18:00:12 +0000</pubDate>
		<dc:creator>Jeroen Doens</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Data Types]]></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=120</guid>
		<description><![CDATA[When you want to create a new NumberSequence in AX you have to do the following steps: 1. Create a new Extended Data Type (EDT). Often this EDT extends from num. (this step is not mandatory, but it is a best practice) 2. Discide in witch module this new Number Sequence Reference (classes NumberSeqReference_&#8230;) should [...]]]></description>
			<content:encoded><![CDATA[<p>When you want to create a new NumberSequence in AX you have to do the following steps:<br />
1. Create a new Extended Data Type (EDT). Often this EDT extends from num. (this step is not mandatory, but it is a best practice)</p>
<p>2. Discide in witch module this new Number Sequence Reference (classes NumberSeqReference_&#8230;) should be included and find the corresponding NumberSeqReference class. (ex. module sales &#8211;&gt; NumberSeqReference_SalesOrder)</p>
<p>3. The loadModule() method shows a number of blocks of code, which creates records in the table NumberSequenceReference.</p>
<p>4.Copy a block and change the following fields:<br />
* <strong>DataTypeID </strong>is the type Id of the new data type.<br />
* <strong>referenceLabel </strong>is the description shown in the left column of the Number sequence tab on the parameters form.<br />
* <strong>referenceHelp </strong>is the longer description of the reference shown in the top part of the Number sequence tab of the parameters form.<br />
* <strong>sortfield </strong>defines the sequence that the references are displayed on the Number sequence tab of the parameters form.<br />
* The <strong>wizard fields</strong> are default values when using the wizard to create a numbersequenceexample:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;">numRef.<span style="color: #000000;">DataTypeId</span> <span style="color: #00007f;">=</span> typeId2ExtendedTypeId<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">typeid</span><span style="color: #000000;">&#40;</span>NewType<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
numRef.<span style="color: #000000;">ReferenceLabel</span> <span style="color: #00007f;">=</span> <span style="color: #0000ff;">literalstr</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;@...&quot;</span><span style="color: #000000;">&#41;</span>;
numRef.<span style="color: #000000;">ReferenceHelp</span> <span style="color: #00007f;">=</span> <span style="color: #0000ff;">literalstr</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;@...&quot;</span><span style="color: #000000;">&#41;</span>;
numRef.<span style="color: #000000;">WizardManual</span> <span style="color: #00007f;">=</span> NoYes<span style="color: #00007f;">::</span><span style="color: #000000;">No</span>;
numRef.<span style="color: #000000;">WizardAllowChangeDown</span> <span style="color: #00007f;">=</span> NoYes<span style="color: #00007f;">::</span><span style="color: #000000;">No</span>;
numRef.<span style="color: #000000;">WizardAllowChangeUp</span> <span style="color: #00007f;">=</span> NoYes<span style="color: #00007f;">::</span><span style="color: #000000;">No</span>;
numRef.<span style="color: #000000;">SortField</span> <span style="color: #00007f;">=</span> #;
&nbsp;
this.<span style="color: #000000;">create</span><span style="color: #000000;">&#40;</span>numRef<span style="color: #000000;">&#41;</span>;</pre></td></tr></table></div>

<p>5. Create a static method on the parameter table that will be used to retrieve the reference. These methods usually start with &#8220;numref&#8221;.<br />
example:</p>

<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;">static</span> <span style="color: #0000ff;">client</span> <span style="color: #0000ff;">server</span> NumberSequenceReference  numRefNewType<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0000ff;">return</span> NumberSeqReference<span style="color: #00007f;">::</span><span style="color: #000000;">findReference</span><span style="color: #000000;">&#40;</span>typeId2ExtendedTypeId<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">typeid</span><span style="color: #000000;">&#40;</span>NewType<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.doens.be/2009/05/working-with-numbersequences-new-numbersequence/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

