<?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>TechBlog &#187; Basics</title>
	<atom:link href="http://techblog.byllemos.com/tag/basics/feed/" rel="self" type="application/rss+xml" />
	<link>http://techblog.byllemos.com</link>
	<description>Accelerating into the Future with Wisdom about Technology! Ingrid Byllemos</description>
	<lastBuildDate>Tue, 05 Jan 2010 00:04:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>NAV2009: The Sales Header does not exist</title>
		<link>http://techblog.byllemos.com/2009/08/nav2009-the-sales-header-does-not-exist/</link>
		<comments>http://techblog.byllemos.com/2009/08/nav2009-the-sales-header-does-not-exist/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 22:10:08 +0000</pubDate>
		<dc:creator>iby</dc:creator>
				<category><![CDATA[Basics]]></category>
		<category><![CDATA[Navision]]></category>
		<category><![CDATA[2009]]></category>
		<category><![CDATA[Navison]]></category>

		<guid isPermaLink="false">http://techblog.byllemos.com/?p=320</guid>
		<description><![CDATA[<p>I have lately received this error “The Sales Header does not exist” a couple of times in Navision 2009.</p>
<p>First I thought this was caused by a filter not being reset on the form – but I got wiser.<br />&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>I have lately received this error “The Sales Header does not exist” a couple of times in Navision 2009.</p>
<p>First I thought this was caused by a filter not being reset on the form – but I got wiser.<br />
Suddenly I noticed a pattern.<span id="more-320"></span></p>
<p>I got the error every time I “played” with Sales Invoices / Sales Quotes in one company and then changed to another company. If I now tried to use Sales Invoice / Sales Quotes etc I received the error.</p>
<p>After trying using RESET, SELECTLATESTVERSION etc. – I figured out that Navision didn’t clear all values during the change. The Odd thing was that first I got the error; it keept anoying me until I deleted the user’s zup file.</p>
<p>So what to do?</p>
<p>I found out that if a record already exists in the Sales Header table, you will not get the error. So you can either keep an empty record in the table or add it when opening the form.</p>
<p>I don&#8217;t like empty records! So I went with the last solution and used some code similar to this:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="cside"><div class="devcodeoverflow">
SH.RESET;
SH.SETRANGE(SH."Document Type",SH."Document Type"::Quote);
IF SH.COUNT = 0 THEN BEGIN
  SH."Document Type" := SH."Document Type"::Quote;
  SH.INSERT(TRUE);
END;
</div></pre><!--END_DEVFMTCODE--></p>
<p>The code was added on OpenForm on Form 41 &#8220;Sales Quote&#8221;. Similar code was also added to the forms 42 &#8220;Sales Order&#8221;, 43 &#8220;Sales Invoice&#8221; and 44 &#8220;Sales Credit Memo&#8221;.</p>
<p>After this I did not get the error anymore <img src='http://techblog.byllemos.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.byllemos.com/2009/08/nav2009-the-sales-header-does-not-exist/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>No. Series &#8211; are they usable?</title>
		<link>http://techblog.byllemos.com/2008/03/no-series-are-they-usable/</link>
		<comments>http://techblog.byllemos.com/2008/03/no-series-are-they-usable/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 22:54:43 +0000</pubDate>
		<dc:creator>iby</dc:creator>
				<category><![CDATA[Basics]]></category>
		<category><![CDATA[Navision]]></category>
		<category><![CDATA[No. Series]]></category>

		<guid isPermaLink="false">http://techblog.byllemos.com/?p=52</guid>
		<description><![CDATA[<p>In Navision number series are used to handle invoices, credit memo&#8217;s, customers etc. &#8211; actually they are pretty widely used around in Navision.</p>
<p>So how does number series work?<br />
<span id="more-52"></span><br />
Number Series is defined in one table 309&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>In Navision number series are used to handle invoices, credit memo&#8217;s, customers etc. &#8211; actually they are pretty widely used around in Navision.</p>
<p>So how does number series work?<br />
<span id="more-52"></span><br />
Number Series is defined in one table 309 &#8220;No. Series Line&#8221; (actual in 2 tables &#8211; a header and a line table, but we are only interested in the line table). Here you must define a starting no. &#8211; which is of the type code. Every time, a record is being inserted into at table that uses no. series &#8211; a lock will be made on the line table; the next number will be calculated and returned and finally the lock will be released again.</p>
<p>All this is very fine &#8211; but what if 100 users were doing an insert on tables, that all uses no. series, at once.  They would be locking for each other &#8211; which again means, that there would be some wait time.</p>
<p>Is this satisfying for a company, that lets say 100 users are waiting each for approx. 10 sec each in average. (The first user would wait 1 sec, then next 1,1 sec and so on). This is not satisfying for any companies.</p>
<p>So what can we do?</p>
<p>Remove every table that has a lot of real time transactions away from the no. series.</p>
<p>This can be done in different ways. One way is to use an Entry no., where autoincrement is activated, as key. Here you must remember to use biginteger, as integer is likely to run full earlier than biginteger. A second way would be moving no. series for specific areas (no. of tables) out of the no. series, to different setup tables.</p>
<p>Example: add a new no. series code field to a setup table; then add a function GetNextNumber, which increment the no. series field and returns that value. And finally add the call of GetNextNumber to the affected table (OnInsert).</p>
<p>Here you still have the risk for locks &#8211; but in this way you are only locking for one table / functionality and not as by using the no. series line table, for everything that uses no. series.</p>
<p>So back to my question – is no. series usable?</p>
<p>Yes – with tables, that is not having a lot of real time transactions.</p>
<p>No – with tables, that is having a lot of real time transactions. Here I would recommend using biginteger – and if the key field still should be code, then move the no. series functionality to a different table.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.byllemos.com/2008/03/no-series-are-they-usable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

