<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>
	Comments on: Search an entire NAV database with 10 lines of code	</title>
	<atom:link href="https://www.hougaard.com/search-an-entire-nav-database-with-10-lines-of-code/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.hougaard.com/search-an-entire-nav-database-with-10-lines-of-code/</link>
	<description>Do more with apps</description>
	<lastBuildDate>Fri, 23 Feb 2018 15:59:07 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: hougaard		</title>
		<link>https://www.hougaard.com/search-an-entire-nav-database-with-10-lines-of-code/#comment-262</link>

		<dc:creator><![CDATA[hougaard]]></dc:creator>
		<pubDate>Fri, 23 Feb 2018 15:59:07 +0000</pubDate>
		<guid isPermaLink="false">https://www.hougaard.com/?p=943#comment-262</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.hougaard.com/search-an-entire-nav-database-with-10-lines-of-code/#comment-261&quot;&gt;Peter&lt;/a&gt;.

Hi Peter,

FORMAT in NAV2016+ returns as much as you need. Text variables are converted into DotNet String variables with a maximum of a million characters (32 bit limit for wide characters in 16bit).

Other than that, I would not call UPPERCASE(SearchValue) for each single field, that&#039;s quite an big overhead instead of doing it once at the beginning :)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.hougaard.com/search-an-entire-nav-database-with-10-lines-of-code/#comment-261">Peter</a>.</p>
<p>Hi Peter,</p>
<p>FORMAT in NAV2016+ returns as much as you need. Text variables are converted into DotNet String variables with a maximum of a million characters (32 bit limit for wide characters in 16bit).</p>
<p>Other than that, I would not call UPPERCASE(SearchValue) for each single field, that&#8217;s quite an big overhead instead of doing it once at the beginning 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Peter		</title>
		<link>https://www.hougaard.com/search-an-entire-nav-database-with-10-lines-of-code/#comment-261</link>

		<dc:creator><![CDATA[Peter]]></dc:creator>
		<pubDate>Fri, 23 Feb 2018 09:12:49 +0000</pubDate>
		<guid isPermaLink="false">https://www.hougaard.com/?p=943#comment-261</guid>

					<description><![CDATA[Nice, but your FORMAT(R) only returns the first 1024 chars as far as I know. Otherwise you couldn&#039;t do it in 10 lines, you say? 

Challenge accepted!

OnRun()
SearchValue := &#039;NaV&#039;;

Tables.SETRANGE(&quot;Object Type&quot;,Tables.&quot;Object Type&quot;::TableData);
IF Tables.FINDSET THEN REPEAT
  R.CLOSE;
  R.OPEN(Tables.&quot;Object ID&quot;);
  IF R.FINDSET THEN REPEAT
    FOR FldNo := 1 TO R.FIELDCOUNT DO
      IF STRPOS(UPPERCASE(FORMAT(R.FIELDINDEX(FldNo).VALUE)),UPPERCASE(SearchValue))  0 THEN
        ERROR(&#039;Found in %1\Found in field: %2\\%3&#039;,R.RECORDID,R.FIELDINDEX(FldNo).NAME,FORMAT(R));
  UNTIL R.NEXT = 0;
UNTIL Tables.NEXT = 0;

I might bend/abuse a single C/AL guideline a tiny bit, but please notice I even had to add an R.CLOSE in my NAV 2009R2, but I also made it case insensitive for free :-)]]></description>
			<content:encoded><![CDATA[<p>Nice, but your FORMAT(R) only returns the first 1024 chars as far as I know. Otherwise you couldn&#8217;t do it in 10 lines, you say? </p>
<p>Challenge accepted!</p>
<p>OnRun()<br />
SearchValue := &#8216;NaV&#8217;;</p>
<p>Tables.SETRANGE(&#8220;Object Type&#8221;,Tables.&#8221;Object Type&#8221;::TableData);<br />
IF Tables.FINDSET THEN REPEAT<br />
  R.CLOSE;<br />
  R.OPEN(Tables.&#8221;Object ID&#8221;);<br />
  IF R.FINDSET THEN REPEAT<br />
    FOR FldNo := 1 TO R.FIELDCOUNT DO<br />
      IF STRPOS(UPPERCASE(FORMAT(R.FIELDINDEX(FldNo).VALUE)),UPPERCASE(SearchValue))  0 THEN<br />
        ERROR(&#8216;Found in %1\Found in field: %2\\%3&#8217;,R.RECORDID,R.FIELDINDEX(FldNo).NAME,FORMAT(R));<br />
  UNTIL R.NEXT = 0;<br />
UNTIL Tables.NEXT = 0;</p>
<p>I might bend/abuse a single C/AL guideline a tiny bit, but please notice I even had to add an R.CLOSE in my NAV 2009R2, but I also made it case insensitive for free 🙂</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
