<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.teachmenav.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"><channel><title>Teach Me NAV</title><link>http://www.teachmenav.com/blogs/</link><description>A site to support our book 'Implementing Microsoft Dynamics NAV 2009'.</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Creating a view across all companies–part 3</title><link>http://www.teachmenav.com/blogs/dave/archive/2010/08/29/creating-a-view-across-all-companies-part-3.aspx</link><pubDate>Sun, 29 Aug 2010 02:31:22 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:447</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;img style="margin:5px;display:inline;" align="left" src="http://i19.photobucket.com/albums/b160/psuedoemo/bear-sitting-picnic-table.jpg" width="200" height="200" alt="" /&gt;&lt;/p&gt;  &lt;p&gt;This is the final part in a three part series of blog posts. In &lt;a href="http://www.teachmenav.com/blogs/dave/archive/2010/08/15/creating-a-view-across-all-companies-part-1.aspx"&gt;part 1&lt;/a&gt; I wrote about how you could use a couple of fields in the $ndo$dbproperty table to create a ConvertInvalidChars() function that would turn your NAV company name into the prefix for the table name as it is used in the SQL database. Then in &lt;a href="http://www.teachmenav.com/blogs/dave/archive/2010/08/22/creating-a-view-across-all-companies-part-2.aspx"&gt;part 2&lt;/a&gt; I showed you how to create a SQL script that would dynamically create your view for all companies that exist in the database. In this final part, I’m going to show you how to link the view to a NAV table and talk about some of the things to watch out for.&lt;/p&gt;  &lt;p&gt;If you’ve followed the previous parts, you should now have a SQL view called Company Vendor that contains every field from the Vendor table in NAV plus a new field called Company Name that contains the company name.&lt;/p&gt;  &lt;h2&gt;Linked Tables&lt;a href="http://teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_52EA26FE.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;margin:5px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" align="right" src="http://teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_65DAE243.png" width="363" height="275" /&gt;&lt;/a&gt;&lt;/h2&gt;  &lt;p&gt;NAV has a neat property on the table definition that allows you to say a table is linked to a view in the database that has the same name as the table name. You can see this property by bringing up the properties for the table and looking at Linked Object. In the next image, you can see the property for my table 50001 is set to Yes. There is another property called LinkedInTransaction and the use of this has often been mysterious, I think because the online help definition is so poor and also because it is very rare for me to try to update the data in the linked object. According to a &lt;a href="http://dynamicsuser.net/forums/p/24642/131913.aspx"&gt;dynamicsuser.net post&lt;/a&gt; from Dean McCrae, when you have LinkedInTransaction set to No, NAV uses a separate connection and separate transaction for accessing the linked tables. This means that if your main connection rollsback due to an error, it does not affect the transaction performed for the linked object. The purpose of LinkedInTransaction is to make the transactions performed on the linked objects isolated from the main transaction. So it only matters if you plan to allow transactions such as inserts, updates and deletes on this linked object. In this example we are not allowing that.&lt;/p&gt;  &lt;h2&gt;Creating the Linked Table&lt;/h2&gt;  &lt;p&gt;I have found the quickest way to create my linked table is to edit my original table (in this case the Vendor table) and then edit the properties to change the ID, Name and set the LinkedObject property to Yes and DataPerCompany to no. I can then save my table. Since my view already exists, it all gets plumbed up correctly. I can now run my table and I see data from both of my companies – but unfortunately I can’t see the company name, and that is because I haven’t added the Company Name field. When I edit my table and add the new Company Name field, I come across the first of the problems with this simple technique. I get a message telling me that “The Record variable must belong to 23 and not to 50001”. The reason for this error is that there is programming logic attached to various triggers on the table that is expecting the table to be the Vendor table (23) and not our new Company Vendor table (50001). In short, you are going to need to remove all programming triggers from your table definition. You can do this easily by pressing Ctrl+S to save the table, the error message will be displayed and when you click OK, you will be taken to the code editing window. Now simply press Ctrl+Home to get to the start of the code, hold the Shift key down and press Ctrl+End so that all text in all programming triggers is selected. Then press delete. Finally, call up the Global variables window, open the Functions tab and select all of the functions, then delete. This will remove those functions that get left behind as empty functions when we deleted the code.&lt;/p&gt;  &lt;h2&gt;Gotchas&lt;/h2&gt;  &lt;p&gt;Although it was really easy for me to create my linked table by saving the existing table, there are a couple of things wrong with this. First of all, I need to remember to remove the programming code from the table, otherwise bad things could happen unexpectedly (such as data being updated in related tables on validates). The other issue relates to FlowFields. The system does not complain about the flowfield definitions in the table but you should be careful of these. The flow fields (such as Balance) are used to sum up the remaining amount on the Vendor Ledger entries for this Vendor, but the system does not know that the Vendor actually exists in a different company. If you are lucky, the flow fields will simply display 0. If you are unlucky there will be a Vendor with the same code in different companies and as a result, you will see a value that is related to the wrong company. My advice to you is to remove the flowfields and flowfilters from your table definition. On the vendor table this is 56 different fields. It’s at this point that I’m starting to wonder whether I actually saved any time by copying the existing table. It’s not actually that hard to go down the list of fields and delete the ones you don’t think you’ll need. You may find that when you delete certain fields from the table, the system complains that the fields are used in an active key. This is a good reason to delete the keys from the table definition too and make the primary key “Company Name”, “No.”.&lt;/p&gt;  &lt;h2&gt;Making the Page&lt;/h2&gt;  &lt;p&gt;My final step is to make a page over my new table. Remember to make the page non-editable and to say Insert Allowed, Delete Allowed and Modify Allowed = No. We don’t want someone accidentally deleting records from the view, because this will delete the actual records from the linked tables (and I have found that it doesn’t care what the underlying table is, even tables like the General Ledger Entry table which you wouldn’t normally be allowed to delete from using a regular user’s license). Here’s a picture of my final page showing how I can search across multiple companies for a specific vendor name.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_0445232D.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_77D70003.png" width="644" height="433" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Have fun with your linked tables.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=447" width="1" height="1"&gt;</description><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Programming/default.aspx">Programming</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/NAV+2009+SP1/default.aspx">NAV 2009 SP1</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/NAV+2009/default.aspx">NAV 2009</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/SQL/default.aspx">SQL</category></item><item><title>Creating a view across all companies—part 2</title><link>http://www.teachmenav.com/blogs/dave/archive/2010/08/22/creating-a-view-across-all-companies-part-2.aspx</link><pubDate>Sun, 22 Aug 2010 04:12:14 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:443</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;a href="http://serverperformancemonitor.com/images/magnifying-glass.jpg"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:0px 4px 4px 0px;display:inline;border-top:0px;border-right:0px;" border="0" align="left" src="http://ts3.mm.bing.net/images/thumbnail.aspx?q=202861448386&amp;amp;id=b1c9a2ea4da7eb04c8bb18b4ca57a871&amp;amp;url=http%3a%2f%2fserverperformancemonitor.com%2fimages%2fmagnifying-glass.jpg" width="160" height="120" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In &lt;a href="http://www.teachmenav.com/blogs/dave/archive/2010/08/15/creating-a-view-across-all-companies-part-1.aspx" target="_blank"&gt;last week’s post&lt;/a&gt; I wrote about how you could use a couple of fields in the $ndo$dbproperty table to create a ConvertInvalidChars() function that would turn your NAV company name into the prefix for the table name as it is used in the SQL database. This week we’re going to write some SQL that will create a dynamic select statement that we can use to create our view.&lt;/p&gt;  &lt;h2&gt;What is Dynamic SQL?&lt;/h2&gt;  &lt;p&gt;Dynamic SQL is when we use programming code to build up our SQL Select statement in a text variable and then execute that statement. In the case of our all company view, we don’t know how many companies we have or what they’re called, so we’re going to need to write something that will read the companies in the database and generate the correct SQL statement for us.&lt;/p&gt;  &lt;p&gt;Here a simple example that shows that you can build up your SQL statement as a string and then use the EXEC() command to execute it.&lt;/p&gt; &lt;code style="font-size:12px;"&gt;&lt;span style="color:blue;"&gt;DECLARE&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@SQLCommand&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;AS&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;VARCHAR&lt;/span&gt;(4000)     &lt;br /&gt;    &lt;br /&gt;&lt;span style="color:blue;"&gt;SET&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@SQLCommand&lt;/span&gt; = &lt;span style="color:red;"&gt;&amp;#39;SELECT Name FROM Company&amp;#39;&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span style="color:blue;"&gt;EXEC&lt;/span&gt;( &lt;span style="color:#8b0000;"&gt;@SQLCommand&lt;/span&gt;)     &lt;br /&gt;&lt;/code&gt;  &lt;p&gt;The results of running this SQL is exactly the same as typing SELECT Name FROM Company into a query window and pressing F5.&lt;/p&gt;  &lt;h2&gt;Going Loopy with Cursors&lt;/h2&gt;  &lt;p&gt;Now we need to build up our SQL statement by looping through each of the companies in the database. To do this we’re going to use a cursor. A cursor is good because it allows you to fetch data back from the database one row at a time and then do something with the results. The downside to cursors is that they are slow (and this is one of the reasons that the performance of NAV is not as good as it could be as it makes extensive use of cursors when fetching data from the server).&lt;/p&gt;  &lt;p&gt;In addition to using a cursor, we’re going to use the UNION ALL statement that will join the results from our select statements together into a single dataset – this is useful since we are trying to create a combined view, which means we need a single result set. Here’s the code:&lt;/p&gt; &lt;code style="font-size:12px;"&gt;&lt;span style="color:blue;"&gt;DECLARE&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@CompanyName&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;AS&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;VARCHAR&lt;/span&gt;(30)     &lt;br /&gt;&lt;span style="color:blue;"&gt;DECLARE&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@SQLCommand&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;AS&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;VARCHAR&lt;/span&gt;(4000) = &lt;span style="color:red;"&gt;&amp;#39;&amp;#39;&lt;/span&gt;     &lt;br /&gt;&lt;span style="color:blue;"&gt;DECLARE&lt;/span&gt; mycur &lt;span style="color:blue;"&gt;CURSOR&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;FOR&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;SELECT&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Name     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;FROM&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Company;     &lt;br /&gt;    &lt;br /&gt;&lt;span style="color:blue;"&gt;OPEN&lt;/span&gt; mycur     &lt;br /&gt;    &lt;br /&gt;&lt;span style="color:blue;"&gt;FETCH&lt;/span&gt; mycur &lt;span style="color:blue;"&gt;INTO&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@CompanyName&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span style="color:blue;"&gt;WHILE&lt;/span&gt;&amp;#160;&lt;span style="color:#ff00dc;"&gt;@@FETCH_STATUS&lt;/span&gt; = 0     &lt;br /&gt;&lt;span style="color:blue;"&gt;BEGIN&lt;/span&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;IF&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@SQLCommand&lt;/span&gt; &amp;lt;&amp;gt; &lt;span style="color:red;"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;SET&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@SQLCommand&lt;/span&gt; += &lt;span style="color:red;"&gt;&amp;#39;UNION ALL &amp;#39;&lt;/span&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;SET&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@SQLCommand&lt;/span&gt; += &lt;span style="color:red;"&gt;&amp;#39;SELECT [Company Name] = &amp;#39;&lt;/span&gt;&lt;span style="color:red;"&gt;&amp;#39;&amp;#39;&lt;/span&gt; + &lt;span style="color:#8b0000;"&gt;@CompanyName&lt;/span&gt; + &lt;span style="color:red;"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span style="color:red;"&gt;&amp;#39;, * FROM [&amp;#39;&lt;/span&gt; + dbo.ConvertInvalidChars( &lt;span style="color:#8b0000;"&gt;@CompanyName&lt;/span&gt;) + &lt;span style="color:red;"&gt;&amp;#39;$Vendor] &amp;#39;&lt;/span&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;FETCH&lt;/span&gt; mycur &lt;span style="color:blue;"&gt;INTO&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@CompanyName&lt;/span&gt;     &lt;br /&gt;&lt;span style="color:blue;"&gt;END&lt;/span&gt;;     &lt;br /&gt;    &lt;br /&gt;&lt;span style="color:#008000;"&gt;--EXEC(@SQLCommand)&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span style="color:blue;"&gt;PRINT&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@SQLCommand&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span style="color:blue;"&gt;CLOSE&lt;/span&gt; mycur     &lt;br /&gt;    &lt;br /&gt;&lt;span style="color:blue;"&gt;DEALLOCATE&lt;/span&gt; mycur     &lt;br /&gt;&lt;/code&gt;  &lt;p&gt;As you can see I’ve commented out my EXEC command and replaced it with a PRINT command so we can see the SQL that gets generated in the message window. Here’s the SQL code it generates (obviously it doesn’t generate all of the formatting, I just inserted that to make it easier to follow the code):&lt;/p&gt; &lt;code style="font-size:12px;"&gt;&lt;span style="color:blue;"&gt;SELECT&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [Company Name] = &lt;span style="color:red;"&gt;&amp;#39;CRONUS Australia Pty. Ltd.&amp;#39;&lt;/span&gt;,     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; *     &lt;br /&gt;&lt;span style="color:blue;"&gt;FROM&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [CRONUS Australia Pty_ Ltd_$Vendor]     &lt;br /&gt;&lt;span style="color:blue;"&gt;UNION&lt;/span&gt;&amp;#160;&lt;span style="color:gray;"&gt;ALL&lt;/span&gt;     &lt;br /&gt;&lt;span style="color:blue;"&gt;SELECT&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [Company Name] = &lt;span style="color:red;"&gt;&amp;#39;CRONUS New Zealand Ltd.&amp;#39;&lt;/span&gt;,     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; *     &lt;br /&gt;&lt;span style="color:blue;"&gt;FROM&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [CRONUS New Zealand Ltd_$Vendor]     &lt;br /&gt;&lt;/code&gt;  &lt;p&gt;If you copied that SQL statement into a query window, you’d see a dataset that contains all of the fields from our Vendor table for each of the companies with a new first column called “Company Name”. Obviously you’d need to change this if you had an actual field called “Company Name” in your table. &lt;/p&gt;  &lt;h2&gt;Making the View&lt;/h2&gt;  &lt;p&gt;The only thing left to do now is put in the CREATE VIEW AS code to create our view. I’m going to call my view Company Vendor. Here’s the final SQL that will create my view.&lt;/p&gt; &lt;code style="font-size:12px;"&gt;&lt;span style="color:blue;"&gt;DECLARE&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@CompanyName&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;AS&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;VARCHAR&lt;/span&gt;(30)    &lt;br /&gt;&lt;span style="color:blue;"&gt;DECLARE&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@SQLCommand&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;AS&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;VARCHAR&lt;/span&gt;(4000) = &lt;span style="color:red;"&gt;&amp;#39;&amp;#39;&lt;/span&gt;    &lt;br /&gt;&lt;span style="color:blue;"&gt;DECLARE&lt;/span&gt; mycur &lt;span style="color:blue;"&gt;CURSOR&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;FOR&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;SELECT&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Name    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;FROM&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Company;    &lt;br /&gt;    &lt;br /&gt;&lt;span style="color:blue;"&gt;OPEN&lt;/span&gt; mycur    &lt;br /&gt;    &lt;br /&gt;&lt;span style="color:blue;"&gt;FETCH&lt;/span&gt; mycur &lt;span style="color:blue;"&gt;INTO&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@CompanyName&lt;/span&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;span style="color:blue;"&gt;WHILE&lt;/span&gt;&amp;#160;&lt;span style="color:#ff00dc;"&gt;@@FETCH_STATUS&lt;/span&gt; = 0    &lt;br /&gt;&lt;span style="color:blue;"&gt;BEGIN&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;IF&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@SQLCommand&lt;/span&gt; &amp;lt;&amp;gt; &lt;span style="color:red;"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;SET&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@SQLCommand&lt;/span&gt; += &lt;span style="color:red;"&gt;&amp;#39;UNION ALL &amp;#39;&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;ELSE&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;SET&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@SQLCommand&lt;/span&gt; += &lt;span style="color:red;"&gt;&amp;#39;CREATE VIEW [Company Vendor] AS &amp;#39;&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;SET&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@SQLCommand&lt;/span&gt; += &lt;span style="color:red;"&gt;&amp;#39;SELECT [Company Name] = &amp;#39;&lt;/span&gt;&lt;span style="color:red;"&gt;&amp;#39;&amp;#39;&lt;/span&gt; + &lt;span style="color:#8b0000;"&gt;@CompanyName&lt;/span&gt; + &lt;span style="color:red;"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span style="color:red;"&gt;&amp;#39;, * FROM [&amp;#39;&lt;/span&gt; + dbo.ConvertInvalidChars( &lt;span style="color:#8b0000;"&gt;@CompanyName&lt;/span&gt;) + &lt;span style="color:red;"&gt;&amp;#39;$Vendor] &amp;#39;&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;FETCH&lt;/span&gt; mycur &lt;span style="color:blue;"&gt;INTO&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@CompanyName&lt;/span&gt;    &lt;br /&gt;&lt;span style="color:blue;"&gt;END&lt;/span&gt;;    &lt;br /&gt;    &lt;br /&gt;&lt;span style="color:blue;"&gt;EXEC&lt;/span&gt;( &lt;span style="color:#8b0000;"&gt;@SQLCommand&lt;/span&gt;)    &lt;br /&gt;    &lt;br /&gt;&lt;span style="color:blue;"&gt;PRINT&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@SQLCommand&lt;/span&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;span style="color:blue;"&gt;CLOSE&lt;/span&gt; mycur    &lt;br /&gt;    &lt;br /&gt;&lt;span style="color:blue;"&gt;DEALLOCATE&lt;/span&gt; mycur    &lt;br /&gt;&lt;/code&gt;  &lt;p&gt;Next week we&amp;#39;ll look at the final steps of making this view available as a linked table in NAV and talk about some of the potential gotcha’s.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=443" width="1" height="1"&gt;</description><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Programming/default.aspx">Programming</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/NAV+2009+SP1/default.aspx">NAV 2009 SP1</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/NAV+2009/default.aspx">NAV 2009</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/SQL/default.aspx">SQL</category></item><item><title>Creating a view across all companies–part 1</title><link>http://www.teachmenav.com/blogs/dave/archive/2010/08/15/creating-a-view-across-all-companies-part-1.aspx</link><pubDate>Sun, 15 Aug 2010 00:31:11 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:442</guid><dc:creator>David Roys</dc:creator><slash:comments>2</slash:comments><description>&lt;h2&gt;The Linked Table&lt;/h2&gt;  &lt;p&gt;&lt;a href="http://teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_47D3F8C2.png"&gt;&lt;img style="border-right-width:0px;margin:0px 10px 10px 0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" class="wlDisabledImage" title="image" border="0" alt="image" align="left" src="http://teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_127AC090.png" width="125" height="123" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Have you ever wanted to search across multiple companies in a NAV database simultaneously? It&amp;#39;s really not that difficult as long as you&amp;#39;re using a SQL database. In this series of blog posts, I&amp;#39;ll give you a step by step guide on how to create a combined vendor list. This principal can be applied to any of the tables in NAV. First of all, we need to cover some basics.&lt;/p&gt;  &lt;p&gt;NAV has the facility to create a table definition that is linked to a view in the database that has the same name as the table. This can be a useful way to directly access data from other systems from within NAV, but it can also be useful for aggregating data that already exists in the NAV database. This could be combining data from multiple companies into a single view, as in this example, or could be combining G/L Entries and Dimensions into a single screen with the ability to search and filter on the dimensions. You could even use this technique to speed up slow processes by using SQL&amp;#39;s powerful set-based queries to replace a lot of effort needed by NAV&amp;#39;s much slower cursor-based operations.&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;To follow this example you&amp;#39;ll need a sample NAV database that you can play in without breaking anything and access to SQL Management Studio.&lt;/p&gt;  &lt;h2&gt;Getting Rid of Invalid Characters&lt;/h2&gt;  &lt;p&gt;If you’ve ever looked at the table names in a SQL database for Dynamics NAV, you’ll have noticed that the table names have the company name at the start and that certain characters have been replaced. In the demo database for New Zealand, we have two companies: CRONUS Australia Pty. Ltd. and CRONUS New Zealand Ltd. If I look for the Vendor table in SQL I’ll see the following two table names:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;CRONUS Australia Pty_ Ltd_$Vendor &lt;/li&gt;    &lt;li&gt;CRONUS New Zealand Ltd_$Vendor&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;As you can see it’s basically the company name with a dollar sign followed by the table name, but some characters have been replaced. This is because when NAV creates the underlying SQL tables, it replaces some “invalid characters”. It does the same for the field names too.&lt;/p&gt;  &lt;p&gt;In this first part of our series on creating a view across all companies, we’ll create a function that will help us find the correct company name as used as the prefix for NAV tables.&lt;/p&gt;  &lt;p&gt;The characters that get replaced are stored in a field called invalididentifierchars in a system table [$ndo$dbproperty] (the square brackets aren’t actually part of the table name, they just make tell SQL to ignore funny characters like the dollar sign and any spaces that may be part of the table name). There’s another useful field in the [$ndo$dbproperty] table that we’ll need for this exercise called convertidentifiers. This tells the system whether we want to bother converting identifiers or not. You can change both of these fields by going to the Classic Client for SQL and selecting &lt;strong&gt;Database &amp;gt; Alter&lt;/strong&gt; from the &lt;strong&gt;File&lt;/strong&gt; menu. Click on the Integration tab and you’ll see the options.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_0363E1B6.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" class="wlDisabledImage" title="image" border="0" alt="image" src="http://teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_7761F181.png" width="644" height="274" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;We need to check to see if the Convert identifiers flag is set and, if it is, remove each of the characters from our company name and replace with an underscore.&lt;/p&gt;  &lt;p&gt;I’m going to create a SQL Function called ConvertInvalidChars that will do this for me. Here’s the SQL code. You should execute this in the NAV database.&lt;/p&gt; &lt;code style="font-size:12px;"&gt;&lt;span style="color:blue;"&gt;IF&lt;/span&gt; OBJECT_ID( &lt;span style="color:red;"&gt;N&amp;#39;dbo.ConvertInvalidChars&amp;#39;&lt;/span&gt;,&lt;span style="color:red;"&gt;N&amp;#39;FN&amp;#39;&lt;/span&gt;) &lt;span style="color:gray;"&gt;IS&lt;/span&gt;&amp;#160;&lt;span style="color:gray;"&gt;NOT&lt;/span&gt;&amp;#160;&lt;span style="color:#a9a9a9;"&gt;NULL&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;DROP&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;FUNCTION&lt;/span&gt; dbo.ConvertInvalidChars;     &lt;br /&gt;GO     &lt;br /&gt;&lt;span style="color:blue;"&gt;CREATE&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;FUNCTION&lt;/span&gt; dbo.ConvertInvalidChars     &lt;br /&gt;(&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#8b0000;"&gt;@p_StringToConvert&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;AS&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;VARCHAR&lt;/span&gt;(250)     &lt;br /&gt;)     &lt;br /&gt;RETURNS     &lt;br /&gt;&lt;span style="color:blue;"&gt;VARCHAR&lt;/span&gt;(250)     &lt;br /&gt;&lt;span style="color:blue;"&gt;AS&lt;/span&gt;&amp;#160; &lt;br /&gt;&amp;#160;&lt;span style="color:blue;"&gt;BEGIN&lt;/span&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;DECLARE&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@InvalidIdentifierChars&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;AS&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;VARCHAR&lt;/span&gt;(128)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;DECLARE&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@X&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;AS&lt;/span&gt; INTEGER     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;DECLARE&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@ConvertIdentifiers&lt;/span&gt;&amp;#160;&lt;span style="color:blue;"&gt;AS&lt;/span&gt; INTEGER     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;SELECT&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#8b0000;"&gt;@ConvertIdentifiers&lt;/span&gt; = convertidentifiers,     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#8b0000;"&gt;@InvalidIdentifierChars&lt;/span&gt; = invalididentifierchars     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;FROM&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [$ndo$dbproperty]     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;IF&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@ConvertIdentifiers&lt;/span&gt; &amp;lt;&amp;gt; 1 &lt;span style="color:blue;"&gt;RETURN&lt;/span&gt;(&lt;span style="color:#8b0000;"&gt;@p_StringToConvert&lt;/span&gt;)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;SET&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@X&lt;/span&gt; = 1     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;WHILE&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@X&lt;/span&gt; &amp;lt;= &lt;span style="color:#ff00dc;"&gt;LEN&lt;/span&gt;( &lt;span style="color:#8b0000;"&gt;@InvalidIdentifierChars&lt;/span&gt;)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;BEGIN&lt;/span&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;SET&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@p_StringToConvert&lt;/span&gt; = &lt;span style="color:#ff00dc;"&gt;REPLACE&lt;/span&gt;( &lt;span style="color:#8b0000;"&gt;@p_StringToConvert&lt;/span&gt;,&lt;span style="color:#ff00dc;"&gt;SUBSTRING&lt;/span&gt;( &lt;span style="color:#8b0000;"&gt;@InvalidIdentifierChars&lt;/span&gt;,&lt;span style="color:#8b0000;"&gt;@X&lt;/span&gt;,1),&lt;span style="color:red;"&gt;&amp;#39;_&amp;#39;&lt;/span&gt;)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;SET&lt;/span&gt;&amp;#160;&lt;span style="color:#8b0000;"&gt;@X&lt;/span&gt; = &lt;span style="color:#8b0000;"&gt;@X&lt;/span&gt; + 1     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;END&lt;/span&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;RETURN&lt;/span&gt;(&lt;span style="color:#8b0000;"&gt;@p_StringToConvert&lt;/span&gt;)     &lt;br /&gt;&lt;span style="color:blue;"&gt;END&lt;/span&gt;     &lt;br /&gt;GO     &lt;br /&gt;    &lt;br /&gt;&lt;/code&gt;  &lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;  &lt;h2&gt;&lt;font face="Calibri"&gt;Testing our Function&lt;/font&gt;&lt;/h2&gt;  &lt;p&gt;&lt;font face="Calibri"&gt;That previous bit of SQL will give us a SQL function that we can use in our code later on. Here’s an example of a select statement that uses the function.&lt;/font&gt;&lt;/p&gt; &lt;code style="font-size:12px;"&gt;&lt;span style="color:blue;"&gt;SELECT&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Name,    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [No Invalid Chars Name] = dbo.ConvertInvalidChars( Name),    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [NAV Vendor &lt;span style="color:blue;"&gt;Table&lt;/span&gt; Name] = &lt;span style="color:red;"&gt;&amp;#39;[&amp;#39;&lt;/span&gt; + dbo.ConvertInvalidChars( Name) + &lt;span style="color:red;"&gt;&amp;#39;$&amp;#39;&lt;/span&gt; + dbo.ConvertInvalidChars( &lt;span style="color:red;"&gt;&amp;#39;Vendor&amp;#39;&lt;/span&gt;) + &lt;span style="color:red;"&gt;&amp;#39;]&amp;#39;&lt;/span&gt;    &lt;br /&gt;&lt;span style="color:blue;"&gt;FROM&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Company    &lt;br /&gt;&lt;/code&gt;  &lt;p&gt;&lt;font face="Calibri"&gt;and here’s the output from that select statement.&lt;/font&gt;&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="683"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="192"&gt;&lt;strong&gt;Name&amp;#160;&amp;#160;&amp;#160; &lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="195"&gt;&lt;strong&gt;No Invalid Chars Name&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="294"&gt;&lt;strong&gt;NAV Vendor Table Name&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="192"&gt;CRONUS Australia Pty. Ltd.&lt;/td&gt;        &lt;td valign="top" width="195"&gt;CRONUS Australia Pty_ Ltd_&lt;/td&gt;        &lt;td valign="top" width="294"&gt;[CRONUS Australia Pty_ Ltd_$Vendor]&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="192"&gt;CRONUS New Zealand Ltd.&lt;/td&gt;        &lt;td valign="top" width="195"&gt;CRONUS New Zealand Ltd_&lt;/td&gt;        &lt;td valign="top" width="294"&gt;[CRONUS New Zealand Ltd_$Vendor]&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;code&gt;&lt;font face="Calibri"&gt;Hopefully you can see where I’m going with this. Next week, I’ll show you how we are going to use this function to build a SQL View for combining multiple company tables together.&lt;/font&gt;&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=442" width="1" height="1"&gt;</description></item><item><title>You Could Win Visual Studio 2010 Ultimate + MSDN</title><link>http://www.teachmenav.com/blogs/dave/archive/2010/07/25/you-could-win-visual-studio-2010-ultimate-msdn.aspx</link><pubDate>Sun, 25 Jul 2010 00:02:17 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:440</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;img src="http://www.microsoft.com/visualstudio/_base_v1/images/boxshots/hero_single_ultimate_boxshot.png" alt="" /&gt;&lt;/p&gt;  &lt;p&gt;In order to drive awareness of the recent launch of Visual Studio 2010, Microsoft has given me &lt;font size="4"&gt;&lt;strong&gt;2&lt;/strong&gt;&lt;/font&gt; x Not for Resale (NFR) &lt;strong&gt;&lt;font size="3"&gt;Visual Studio 2010 Ultimate with MSDN subscription cards to give away&lt;/font&gt;&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;Take a look on the &lt;a href="http://www.microsoft.com/visualstudio/en-us/products/2010-editions/ultimate" target="_blank"&gt;Visual Studio Product Site&lt;/a&gt; and you’ll see that to buy one of these subscriptions will set you back a lot of money—but I’m giving them away for free!&lt;/p&gt;  &lt;h3&gt;What do you need to do?&lt;/h3&gt;  &lt;p&gt;As you know, Microsoft Dynamics NAV 2009 SP1 introduced a new feature called Control Add-ins. These are .NET controls that let you do all kinds of stuff like display customer locations using Bing Maps, display Visio diagrams, capture signatures, display charts, have spell checking, edit HTML…all within the RoleTailored client. What a lot of stuff! The thing is, you’re only really limited by your imagination – these are just some examples of controls that have already been created. What control would you create?&lt;/p&gt;  &lt;p&gt;I’m not asking you to build one of these controls to win the prize, I just want you to &lt;strong&gt;&lt;font size="4"&gt;think of an idea for a control add-in and write about it&lt;/font&gt;&lt;/strong&gt;. Write a Word document describing your concept and include pictures (mock-ups or sketches) of how you see it working. You can use any version of Word for your submission, but don’t use other formats because if I can’t read it, you can’t win. Also all submissions must be in English and if you write in Text Speak or some strange form of English that I can’t understand, you’re chances of winning are slim. You’re submission should be around two pages in Word with a picture or two.&lt;/p&gt;  &lt;h3&gt;How do you submit your entry?&lt;/h3&gt;  &lt;p&gt;The purpose of this competition is to get people thinking about custom controls for NAV 2009 SP1 and sharing their ideas. I have created a Forum for you to upload your ideas so they are then shared with everyone. Write a forum post giving a brief outline of your idea and you should be able to attach a Word document to the forum post. The &lt;a href="http://www.teachmenav.com/forums/22.aspx" target="_blank"&gt;Control Add-ins Forum&lt;/a&gt; is here. You need to be registered on TeachMeNAV to be able to make posts. I will need to send an e-mail to you about the prize if you win, so make sure you use a real e-mail address when you register. I’ll put in a sample posting so you know what I’m looking for. I’ll be searching for your idea online so don’t bother just posting someone else’s idea or blog post.&lt;/p&gt;  &lt;h3&gt;Closing Date and Terms and Conditions&lt;/h3&gt;  &lt;ol&gt;   &lt;li&gt;I’ll leave the forum open until the end of August 2010. You must make your submission before then to be in to win.&lt;/li&gt;    &lt;li&gt;Only submissions made through the &lt;a href="http://www.teachmenav.com/forums/22.aspx" target="_blank"&gt;Control Add-ins Forum&lt;/a&gt; will be considered.&lt;/li&gt;    &lt;li&gt;I am going to pick the winners and my decision is final.&lt;/li&gt;    &lt;li&gt;The Visual Studio 2010 MSDN subscription cards are the only prizes. There is no cash alternative and if for any reason your subscription card does not work, you’ll need to sort this out with Microsoft and not with me.&lt;/li&gt;    &lt;li&gt;I’ll announce the winning entries before the end of September 2010.&lt;/li&gt;    &lt;li&gt;The competition is not open to Dynamics NAV MVPs (sorry guys but you already have an MSDN subscription, so let’s give someone else a chance).&lt;/li&gt;    &lt;li&gt;By submitting your ideas, they are shared with the world. If someone decides to build your idea, good luck to them.&lt;/li&gt; &lt;/ol&gt;  &lt;h3&gt;What’s the catch?&lt;/h3&gt;  &lt;p&gt;There’s no catch, but there are some conditions and limitations surrounding the prize.&lt;/p&gt;  &lt;p&gt;The 12-month MSDN subscription has some restrictions with it being a NFR version (technical support benefits and MSDN Magazine are not included, and all software benefits, including Microsoft Office 2010 products, are for development and test purposes only).&lt;/p&gt;  &lt;p&gt;The subscriptions need to be registered within 180 days of when &lt;em&gt;I&lt;/em&gt; received them (that means you have until around the end of December 2010 to register, but I won’t be responsible for you neglecting to register—if you win a prize, register it straight away).&lt;/p&gt;  &lt;h3&gt;Resources&lt;/h3&gt;  &lt;p&gt;The official Microsoft documentation about add-ins online at &lt;a href="http://msdn.microsoft.com/en-us/library/dd983700.aspx"&gt;http://msdn.microsoft.com/en-us/library/dd983700.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Freddy Kristiansen’s Blog &lt;a href="http://blogs.msdn.com/b/freddyk/archive/2009/06/07/integration-to-virtual-earth-part-4-of-4.aspx"&gt;http://blogs.msdn.com/b/freddyk/archive/2009/06/07/integration-to-virtual-earth-part-4-of-4.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Christian Abeln’s blog on Add-ins &lt;a href="http://blogs.msdn.com/b/cabeln/archive/2009/05/06/add-ins-for-the-roletailored-client-of-microsoft-dynamicsnav-2009-sp1-part1.aspx"&gt;http://blogs.msdn.com/b/cabeln/archive/2009/05/06/add-ins-for-the-roletailored-client-of-microsoft-dynamicsnav-2009-sp1-part1.aspx&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=440" width="1" height="1"&gt;</description></item><item><title>Action Images</title><link>http://www.teachmenav.com/blogs/dave/archive/2010/06/22/action-images.aspx</link><pubDate>Tue, 22 Jun 2010 10:55:00 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:439</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;When you want to attach an image to an Action in NAV 2009, you need to pick from one of the standard images and use it to set the Image property. There&amp;rsquo;s a library with all of the 2009 and 2009 SP1 images on MSDN (&lt;a href="http://msdn.microsoft.com/en-us/library/dd568728.aspx" title="http://msdn.microsoft.com/en-us/library/dd568728.aspx"&gt;http://msdn.microsoft.com/en-us/library/dd568728.aspx&lt;/a&gt;). If you don&amp;rsquo;t know about Action Images, take a look at &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/dd568735.aspx"&gt;How to: Set an Image on an Action&lt;/a&gt; on MSDN.&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s a saying that necessity is the mother of invention, and for me that is certainly true. I needed to find an image to use on a new action and it took quite a while to scroll through the list of 310 images, trying to find one that looked vaguely like the action I had created.&lt;/p&gt;
&lt;p&gt;I figured it would be good if instead of scrolling through the entire list, I could search in a document of some kind. I started by cutting out each of the images from the MSDN library image and saving as an individual file with a name of the action image property value.&lt;/p&gt;
&lt;p&gt;Next I loaded these into an &lt;a target="_blank" href="http://teachmenav.com/media/g/actions/default.aspx?Sort=Subject&amp;amp;PageIndex=1"&gt;Action Images Media Gallery&lt;/a&gt; on this site and attached meta-data tags that would make it easier to search. Below is a screen shot of the Tag Cloud for all 310 images.&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.teachmenav.com/media/default.aspx?Sort=Subject&amp;amp;PageIndex=1"&gt;&lt;img height="223" width="644" src="http://teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_3A80968D.png" alt="image" border="0" title="image" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s an example of how it works. Let&amp;rsquo;s say I&amp;rsquo;ve created an action for adding reminders. I can look through the tags and see there&amp;rsquo;s an Alarm Bell tag. I click that and see the following images.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_2F938F78.png"&gt;&lt;img height="237" width="644" src="http://teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_78D63473.png" alt="image" border="0" title="image" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So there are 5 to choose from. I think I&amp;rsquo;d pick the &amp;ldquo;CreateReminders&amp;rdquo; that has the alarm and the sparkle.&amp;nbsp;The Tag Cloud in the side bar shows all tags, but I&amp;#39;m struggling to get the view more link at the bottom of the cloud to show all of the tags.&lt;/p&gt;
&lt;p&gt;This took a ridiculous amount of time to complete. I hope you find it as useful as I do. Oh and the link to the gallery? Here it is &lt;a href="http://www.teachmenav.com/media/default.aspx?Sort=Subject&amp;amp;PageIndex=1"&gt;Action Image Tag Cloud&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=439" width="1" height="1"&gt;</description></item><item><title>Microsoft Dynamics NAV 2009 Application Design</title><link>http://www.teachmenav.com/blogs/dave/archive/2010/06/01/microsoft-dynamics-nav-2009-application-design.aspx</link><pubDate>Tue, 01 Jun 2010 10:10:00 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:128</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;div class="book-image"&gt;&lt;img height="152" width="125" src="https://www.packtpub.com/sites/default/files/imagecache/productview/0967EN_MockupCover.jpg" alt="Microsoft Dynamics NAV 2009 Application Design" title="Microsoft Dynamics NAV 2009 Application Design" class="imagecache imagecache-productview" /&gt;&lt;/div&gt;
&lt;div class="book-image"&gt;I found out today that Mark Brummel (Dynamics NAV MVP and blogger) has written a book on Dynamics NAV 2009. You can read about it on &lt;a href="http://dynamicsuser.net/blogs/mark_brummel/archive/2010/06/01/new-nav-book-microsoft-dynamics-nav-2009-application-design.aspx"&gt;his blog post here&lt;/a&gt;, and you can pre-order from &lt;a href="https://www.packtpub.com/microsoft-dynamics-nav-2009-application-design/book"&gt;the PACKT web site&lt;/a&gt;.&lt;/div&gt;
&lt;div class="book-image"&gt;&lt;/div&gt;
&lt;div class="book-image"&gt;The one thing I did notice was that the PACKT web site has undergone a significant redesign and looks really sharp. You should go an take a look.&lt;/div&gt;
&lt;div class="book-image"&gt;&lt;/div&gt;
&lt;div class="book-image"&gt;Here is some blurb from the PACKT site.&lt;/div&gt;
&lt;div class="book-image"&gt;&lt;/div&gt;
&lt;div class="book-image"&gt;&lt;strong&gt;What you will learn from this book :&lt;br /&gt;&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Implement Microsoft Dynamics NAV ERP suite with a sample industry application throughout the book&lt;/li&gt;
&lt;li&gt;Set up Dynamics NAV and customize it for various industries including fashion, retail, and the automobile industry&lt;/li&gt;
&lt;li&gt;Get to grips with key Dynamics NAV features such as Inventory Valuation, Item Tracking, and Reservations&lt;/li&gt;
&lt;li&gt;Learn about B2B and B2C Interfacing and the fundamentals of Application Design&lt;/li&gt;
&lt;li&gt;Learn and customize application features designed by Microsoft such as Financial Management, CRM, Manufacturing, Distribution / Wholesale, and Retail and extend them safely&lt;/li&gt;
&lt;li&gt;Design your applications to have a good balance between cost of ownership and functionality&lt;/li&gt;
&lt;li&gt;Analyze operation data based on sales demographics using Dynamics NAV CRM&lt;/li&gt;
&lt;li&gt;Extend your core applications using interfaces such as Flatfile, CSV, XMLports, ADO, EDI standards, and web services&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;Approach&lt;/b&gt;&lt;br /&gt;
&lt;p&gt;This book is a tutorial in an easy-to-read style. It will show Dynamics NAV developers how to create applications of different kinds with sufficient examples throughout.&lt;/p&gt;
&lt;b&gt;Who this book is written for&lt;/b&gt;&lt;br /&gt;
&lt;p&gt;If you are a NAV consultant and developer, or designer of business applications you will benefit most from this book.&lt;/p&gt;
&lt;p&gt;The book assumes that you have a basic understanding of business management systems and application development, with a working knowledge of Microsoft Dynamics NAV.&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="book-image"&gt;Well done to Mark for such a huge effort. I look forward to reading it.&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=128" width="1" height="1"&gt;</description><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Book+News/default.aspx">Book News</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/NAV+2009/default.aspx">NAV 2009</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Writing/default.aspx">Writing</category></item><item><title>Dropbox Rocks</title><link>http://www.teachmenav.com/blogs/dave/archive/2010/04/05/dropbox-rocks.aspx</link><pubDate>Sun, 04 Apr 2010 20:21:46 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:119</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I’ve been using Dropbox to help with my writing. It’s a great tool and I think anyone that’s writing for a hobby should have it in their kitbag.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_4C1C221C.png"&gt;&lt;img style="border-right-width:0px;display:block;float:none;border-top-width:0px;border-bottom-width:0px;margin-left:auto;border-left-width:0px;margin-right:auto;" title="image" border="0" alt="image" src="http://teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_5528AD9D.png" width="260" height="193" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;They sent me a link that helps people sign up that will give me more storage if you follow it (that’s what the referrals part at the end of the link is all about). It’s totally free and you get 2GB storage and backups for no charge. You can of course pay for more storage if you need it. Here’s the link…&lt;/p&gt;  &lt;p&gt;&lt;a title="https://www.dropbox.com/referrals/NTQ5NjE3MDc5" href="https://www.dropbox.com/referrals/NTQ5NjE3MDc5"&gt;https://www.dropbox.com/referrals/NTQ5NjE3MDc5&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;So what is Dropbox anyway?&lt;/p&gt;  &lt;p&gt;It’s an online storage area that means you can easily access your writing from any computer.&lt;/p&gt;  &lt;p&gt;A program installed on my computer allows me to work with files in a folder (nothing special, you just nominate which folder will be your Dropbox folder) then whenever you save to this folder or drag files into it, the file gets uploaded to the Cloud storage in the background. It’s that easy!&lt;/p&gt;  &lt;p&gt;You can have Dropbox installed on many computers accessing the same account or you can access the files through the Web interface. I have it installed on my home and work computer and on my iPhone, which means that I can work on the same documents on any of these devices and don’t need to worry about keeping different versions in sync.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=119" width="1" height="1"&gt;</description><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Writing/default.aspx">Writing</category></item><item><title>About This Report – No need to run reports twice</title><link>http://www.teachmenav.com/blogs/dave/archive/2010/03/14/about-this-report-no-need-to-run-reports-twice.aspx</link><pubDate>Sun, 14 Mar 2010 03:18:42 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:118</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_02A70875.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_6649A087.png" width="640" height="340" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;It&amp;#39;s been a while since I last made a post and there are a few reasons. Bejweled Blitz on the iPhone is a big part, but also, it seems that there has been a real period of consolidation for me just recently: taking a lot of the things I learnt and applying them on projects, so not a lot of new stuff to share, just lots of time-consuming work. That&amp;#39;s the excuses for not blogging out of the way, now on with the post.&lt;/p&gt;  &lt;p&gt;I came across a top tip yesterday courtesy of a work colleague and felt it was simply too good not to share. If you do any report development in NAV 2009, keep reading.&lt;/p&gt;  &lt;p&gt;One of the mysteries of working reports in NAV 2009 is understanding what is in the dataset when the reporting services client renders the report. In NAV 2009 we had the undocumented Ctrl+Shift+Alt+F12 key press which you could use when previewing the report. This key press opens a window with a list containing the entire dataset, allowing you to copy and paste into Excel. This is great for figuring out how you should be sorting and grouping your dataset for the required results.&lt;/p&gt;  &lt;p&gt;Then when SP1 for NAV 2009 came out we got the Ctrl+Alt+F1 (About This Report) key press that could be used to do the same, but for reasons that I can only assume are related to the way data is paged on the client, the first time you select the option after previewing the report you get told you need to run the report again and select the About This Report option again. This need to repeat your actions in order to get your goal is mildly annoying. This is where the top tip comes in. When your options page for the report is displayed, select Ctrl+Alt+F1, About This Page. Now when you preview the report you can press Ctrl+Alt+F1 and see the full dataset and you don’t need to run the report again. It&amp;#39;s not perfect but better than having to run the report twice.&lt;/p&gt;  &lt;p&gt;So what would be a better way of doing this? I would suggest a setting in the config file that says keep dataset for reports. This way, developers could have this setting on and end users could leave it switched off.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=118" width="1" height="1"&gt;</description><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Programming/default.aspx">Programming</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/NAV+2009+SP1/default.aspx">NAV 2009 SP1</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Tip/default.aspx">Tip</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Reporting/default.aspx">Reporting</category></item><item><title>NAV 2009 Server Starts and then Stops</title><link>http://www.teachmenav.com/blogs/dave/archive/2010/01/20/nav-2009-server-starts-and-then-stops.aspx</link><pubDate>Wed, 20 Jan 2010 00:31:38 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:116</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Have you ever tried to create a NAV 2009 Server service that runs under a domain account and when you try to start it, the service starts and them immediately stops again.&lt;/p&gt;  &lt;p&gt;Then, if you look in the Windows Event Log for the error message you see something like this…&lt;/p&gt;  &lt;p&gt;&lt;em&gt;The service MicrosoftDynamicsNavServer$DynamicsNAV failed to start. This could be caused by a configuration error. Detailed error information:System.ServiceModel.CommunicationException: The service endpoint failed to listen on the URI &amp;#39;net.tcp://vm-dev-100118.rad.intergen.org.nz:7046/DynamicsNAV/Service&amp;#39; because access was denied.&amp;#160; Verify that the current user is granted access in the appropriate allowedAccounts section of SMSvcHost.exe.config. ---&amp;gt; System.ComponentModel.Win32Exception: Access is denied&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;I’ve had this a few times and my sledgehammer solution has been to make the domain account that is running the service a member of the local machine Administrators group. OK, I realise this is overkill but it works.&lt;/p&gt;  &lt;p&gt;Today I finally took the time to figure out the correct way of granting the permissions to the domain account to allow it to listen on the specified port.&lt;/p&gt;  &lt;p&gt;First of all we need to know the SID for the domain account. There may be other ways to find this out, but here is a suggestion that works:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Start a command prompt running under the context of the user you want to know the SID for by typing runas /user:domain\nav2009nstuser cmd.exe in a command prompt where domain is your domain and nav2009nstuser is the account that is running the NAV Server Tier. &lt;/li&gt;    &lt;li&gt;The system will prompt for the nav2009nstuser password. &lt;/li&gt;    &lt;li&gt;A new command prompt opens and you will notice in the title of the window it says cmd.exe (running as domain\nav2009nstuser). &lt;/li&gt;    &lt;li&gt;In this new command window type whoami /user &lt;/li&gt;    &lt;li&gt;You will see the SID of the user account. Copy this as you will need it in the next step. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;These instructions are meant to work on Windows 7, so apologies if some of these things don’t work for you.&lt;/p&gt;  &lt;p&gt;Now you need to edit the C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\SMSvcHost.exe.config file or the C:\Windows\Microsoft.NET\Framework64\v3.0\Windows Communication Foundation\SMSvcHost.exe.config file.&lt;/p&gt;  &lt;p&gt;The file includes a &amp;lt;runtime&amp;gt; element and beneath that a commented out section that shows what to include for the net.tcp permissions we want to add. Insert the following section below the &amp;lt;/runtime&amp;gt; closing tag and before the start of the comment as so that part of the file looks like this…&lt;/p&gt;  &lt;p&gt;&amp;lt;/runtime&amp;gt;   &lt;br /&gt;&amp;lt;system.serviceModel.activation&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;net.tcp listenBacklog=&amp;quot;10&amp;quot; maxPendingConnections=&amp;quot;100&amp;quot; maxPendingAccepts=&amp;quot;2&amp;quot; receiveTimeout=&amp;quot;00:00:10&amp;quot; teredoEnabled=&amp;quot;false&amp;quot;&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;allowAccounts&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;add securityIdentifier=&amp;quot;S-1-1-1 this is your SID&amp;quot;/&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/allowAccounts&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/net.tcp&amp;gt;    &lt;br /&gt;&amp;lt;/system.serviceModel.activation&amp;gt;    &lt;br /&gt;&amp;lt;!-- Below are some sample config settings:&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;replacing S-1-1-1 this is your SID with the correct SID you found in the previous step.&lt;/p&gt;  &lt;p&gt;Now reboot the machine (restarting the service is not enough).&lt;/p&gt;  &lt;p&gt;Your service should now start correctly. Thanks to Dominick Baier who posted on &lt;a title="http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b1cc46af-a70d-4793-b5fe-b61450ef5387" href="http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b1cc46af-a70d-4793-b5fe-b61450ef5387"&gt;http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b1cc46af-a70d-4793-b5fe-b61450ef5387&lt;/a&gt; which gave me the info I needed to get this working.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=116" width="1" height="1"&gt;</description><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/.NET/default.aspx">.NET</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Gotcha/default.aspx">Gotcha</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/NAV+2009+SP1/default.aspx">NAV 2009 SP1</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/NAV+2009/default.aspx">NAV 2009</category></item><item><title>The specified path is invalid. When using UPLOADINTOSTREAM.</title><link>http://www.teachmenav.com/blogs/dave/archive/2010/01/01/the-specified-path-is-invalid-when-using-uploadintostream.aspx</link><pubDate>Fri, 01 Jan 2010 02:16:21 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:113</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I recently tried using UPLOADINTOSTREAM to load a file from the RoleTailored client into a temporary file on the NAV Server so that I could then process it. This is needed in NAV 2009 because it has three tiers and the tier on which the code executes does not necessarily have access to the files that are accessible on the client. Think about it, you’re c: drive is not the same place as the c: drive on the server.&lt;/p&gt;  &lt;p&gt;I tried using the F5 C/AL Symbol Menu to paste the function call with its arguments because, to be frank, I can never remember stuff like this. This pasted the following line of code:&lt;/p&gt;  &lt;p&gt;[Ok :=] UPLOADINTOSTREAM(DialogTitle, FromFolder, FromFilter, FromFile, NVInStream)&lt;/p&gt;  &lt;p&gt;I then replaced the parameters with the appropriate text strings and variables which gave me this:&lt;/p&gt;  &lt;p&gt;UPLOADINTOSTREAM(&amp;#39;Profile Metadata&amp;#39;, &amp;#39;&amp;#39;, &amp;#39;*.XML&amp;#39;, FileName, InStream);&lt;/p&gt;  &lt;p&gt;FileName and InStream variables of type Text 1024 and InStream respectively.&lt;/p&gt;  &lt;p&gt;When I tried to run this command I kept getting this error message:&lt;/p&gt;  &lt;p align="center"&gt;&lt;font size="2" face="Courier New"&gt;Microsoft Dynamics NAV      &lt;br /&gt;--------------------------- &lt;/font&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;font size="2" face="Courier New"&gt;The specified path is invalid.      &lt;br /&gt;---------------------------       &lt;br /&gt;OK       &lt;br /&gt;---------------------------&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;I couldn’t figure out why I was getting this error, but it turns out using an incorrect value in the FromFilter was causing the problem.&lt;/p&gt;  &lt;p&gt;When I changed my line of code to be more like the example in the online help it all worked fine:&lt;/p&gt;  &lt;p&gt;UPLOADINTOSTREAM(&amp;#39;Profile Metadata&amp;#39;, &amp;#39;&amp;#39;, &amp;#39;XML File *.XML| *.XML&amp;#39;, FileName, InStream);&lt;/p&gt;  &lt;p&gt;I searched for the error message and UPLOADINTOSTREAM in order to find the answer, but found nothing, hence the reason for this blog post.&lt;/p&gt;  &lt;p&gt;Oh, and Happy New Year!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=113" width="1" height="1"&gt;</description><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Programming/default.aspx">Programming</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Gotcha/default.aspx">Gotcha</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/NAV+2009/default.aspx">NAV 2009</category></item><item><title>Book Review: Programming Microsoft Dynamics NAV 2009</title><link>http://www.teachmenav.com/blogs/dave/archive/2009/12/21/book-review-programming-microsoft-dynamics-nav-2009.aspx</link><pubDate>Sun, 20 Dec 2009 22:53:45 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:111</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;table border="0" cellspacing="0" cellpadding="2" width="583"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="200"&gt;&lt;img src="https://www.packtpub.com/images/full/1847196527.jpg" width="194" height="240" alt="" /&gt;&lt;/td&gt;        &lt;td valign="top" width="381"&gt;&lt;strong&gt;Author:&lt;/strong&gt; David Studebaker          &lt;br /&gt;          &lt;br /&gt;&lt;strong&gt;Publisher:&lt;/strong&gt; PACKT          &lt;br /&gt;          &lt;br /&gt;          &lt;p&gt;&lt;strong&gt;ISBN:&lt;/strong&gt; 978-1-847196-52-1            &lt;br /&gt;            &lt;br /&gt;&lt;strong&gt;Published:&lt;/strong&gt; November 2009&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Available from &lt;a title="the PACKT web site" href="http://www.packtpub.com/programming-microsoft-dynamics-nav-2009/mid/2907099ks64d?utm_source=teachmenav.com&amp;amp;utm_medium=affiliate&amp;amp;utm_content=blog&amp;amp;utm_campaign=mdb_000066"&gt;the PACKT web site&lt;/a&gt; and &lt;a title="Amazon.com" href="http://www.amazon.com/gp/product/1847196527?ie=UTF8&amp;amp;tag=gassbradum-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=1847196527"&gt;Amazon.com&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;When I saw that David Studebaker had written a new book on Programming Microsoft Dynamics NAV 2009, the first thing I wanted to know was whether this is a completely new book or a tarted-up version of his previous book &lt;a href="http://gaspodethewonderdog.blogspot.com/2007/12/book-review-programming-microsoft.html" target="_blank"&gt;which I reviewed in December 2007&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Now that I have finished reading it (and it’s a whopping 559 pages in 9 chapters) I can tell you that it’s a bit of both. There is a lot of new content in this book and the programming scenario that flows throughout the book has been completely redone and is, in my opinion, much improved. The whole book has a fresh new approach but I kept getting a sense of déjà lu. The ‘read it before’ feeling is not surprising: this is a re-write and if you open this book and the previous one side-by-side, you’ll see a lot of the content is fundamentally the same. That’s fair enough, there’s only so much you can write on the subject of programming NAV and the re-writing and corrections has improved the book greatly.&lt;/p&gt;  &lt;p&gt;Each chapter finishes with a pop quiz with a number of carefully considered questions to help you determine whether you have grasped the basic concepts. The book is much easier to read than the previous version, and there are considerably less mistakes (I still managed to find a few although the majority were proofing errors rather than programming errors).&lt;/p&gt;  &lt;p&gt;Sadly for me, the chapter on Forms has been re-written as a chapter on Pages which means this book is no longer a complete introduction to NAV programming and if you want to learn about creating Forms, we are told to buy the other book as well (or if you’re on a budget, you could consider reading the &lt;a href="http://www.packtpub.com/files/implementing-microsoft-dynamics-nav-2009-sample-chapter-6-modifying-the-system.pdf" target="_blank"&gt;sample chapter of my book&lt;/a&gt; instead). There is no mention of Form transformation, which for me is a large part of NAV 2009 development. At the moment, the easiest way to develop and maintain NAV 2009 is to create Forms and use the Form Transformation tool to create the pages. This book is not going to help you do that, although you will get a good understanding of what pages are and what you can do with them. If you want some help with the more complex areas, such as Page Transformation, advanced Report Transformation or Matrix Pages, you should consider &lt;a href="http://www.teachmenav.com/blogs/dave/archive/2009/06/28/book-review-microsoft-dynamics-nav-2009-inside.aspx" target="_blank"&gt;Rene Gayer’s book&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;When I wrote my original review of Programming Microsoft Dynamics NAV two years ago, I said that this was the only book on programming NAV and that is reason enough to buy it. There are now two other books on NAV 2009, &lt;a href="http://www.teachmenav.com/blogs/dave/archive/2009/06/28/book-review-microsoft-dynamics-nav-2009-inside.aspx" target="_blank"&gt;Rene’s book&lt;/a&gt; and &lt;a href="http://www.packtpub.com/implementing-microsoft-dynamics-nav-2009/book/mid/190109h5mbvn" target="_blank"&gt;the one I co-authored with Vjeko&lt;/a&gt;. There is &lt;a href="http://msdn.microsoft.com/en-us/library/dd448639.aspx" target="_blank"&gt;Microsoft Dynamics NAV 2009 Developer and IT Pro Documentation&lt;/a&gt; available online at msdn and there are now some amazing blogs that cover advanced topics such as creating Web service-consuming applications and RTC Client Add-ins, so the question remains, should you buy this book?&lt;/p&gt;  &lt;p&gt;If you are new to programming NAV and have not read David’s previous book, then this is a great book for you and you will learn a lot from it. Definitely buy it.&lt;/p&gt;  &lt;p&gt;If you have read David’s previous book and are now looking for a guide to what’s new in NAV 2009 you should probably consider other sources that will give you the overview of what’s new with a lot more new content (such as my book, Rene’s book or the online articles and blogs).&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Postscript for the E-book Enthusiasts&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/iPhoneReader_5F00_1EC73821.jpg"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="" border="0" alt="" src="http://teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/iPhoneReader_5F00_thumb_5F00_67317732.jpg" width="244" height="151" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;As part of my review of this book, I wanted to try reading the e-book version so that I could compare that to the printed copy. Printed books still have a lot of advantages over e-books, although I think you should consider buying both if you can afford it. This gives you the ease and comfort of reading a paper book with the convenience of being able to search the contents for a specific topic. There are some good deals when buying both the e-book and the p-book from the Packt web site, although it’s a shame you don’t get the e-book for free when you buy the printed copy. I first tried reading the e-book using my Sony PRS-505 Reader &lt;a href="http://www.sony.co.uk/hub/reader-ebook"&gt;http://www.sony.co.uk/hub/reader-ebook&lt;/a&gt; . This uses electronic ink to display the text which provides a close-to-paper reading experience. The PDF document format is not ideally suited to the PRS-505. The large white space borders mean the text is tiny even if you read it in split-page landscape mode. You can reflow the text to increase the text size but this spoils the layout. The book is also so large that re-flowing it locked my reader for over 20 minutes. Next I tried using GoodReader (&lt;a href="http://www.goodreader.net/goodreader.html"&gt;http://www.goodreader.net/goodreader.html&lt;/a&gt;) on my Apple iPhone to read the book. This was great. GoodReader lets you zoom the display to get rid of the large borders and then lock the horizontal scroll making it easy to flick through the text. I actually read quite a bit of the book like this and I found the text clear and the images crisp. If you have an iPhone or iPod touch, you should seriously consider this as an option.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=111" width="1" height="1"&gt;</description></item><item><title>Sample Book Chapters</title><link>http://www.teachmenav.com/blogs/dave/archive/2009/11/27/sample-book-chapters.aspx</link><pubDate>Fri, 27 Nov 2009 05:31:00 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:104</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I wanted to find something from Chapter 7 of my book today and I realised that I hadn&amp;#39;t posted links to the sample chapters. There are two sample chapters available. Chapter 7 is presented in two articles on the PACKT article network and Chapter 6 is available as a PDF download directly from the PACKT web site and also from MIBUSO.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.packtpub.com/files/implementing-microsoft-dynamics-nav-2009-sample-chapter-6-modifying-the-system.pdf"&gt;Chapter 6: Modifying the System (PDF)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.packtpub.com/article/extending-application-using-microsoft-dynamics-nav-2009-part1"&gt;Chapter 7 Part 1: Extending the Application (part 1 as an online article)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.packtpub.com/article/extending-application-using-microsoft-dynamics-nav-2009-part2"&gt;Chapter 7 Part 2: Extending the Application (part 2 as an online article)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=104" width="1" height="1"&gt;</description><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Sample+Chapters/default.aspx">Sample Chapters</category></item><item><title>Where did my xRec go?</title><link>http://www.teachmenav.com/blogs/dave/archive/2009/11/02/where-did-my-xrec-go.aspx</link><pubDate>Sun, 01 Nov 2009 22:08:19 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:92</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;In the RoleTailored client on a Page, the xRec does not contain a record when you are inserting new records into a sub page. Previously if you wanted to know where you had pressed F3 to insert a line you could take a look at xRec and would know which line you were on when you pressed F3.&lt;/p&gt;  &lt;p&gt;Unfortunately in the RTC the xRec is completely blank (when checking in the field validation triggers).&lt;/p&gt;  &lt;p&gt;Fortunately the xRec is not blank when it hits the onNewRecord() trigger so you can have a global variable on your form (I called mine g_MyXRec) and then assign it in that trigger, all is OK again.&lt;/p&gt;  &lt;p&gt;Here is an example of the OnNewRecord in the Page 46 Sales Order Subform…&lt;/p&gt;  &lt;p&gt;Type := xRec.Type;   &lt;br /&gt;CLEAR(ShortcutDimCode);    &lt;br /&gt;// My code added to allow me to see xRec --&amp;gt;    &lt;br /&gt;g_MyXRec := xRec;&lt;/p&gt;  &lt;p&gt;With this code in place, I can now use g_MyXRec to see which record I was on when I pressed Ctrl+Ins.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=92" width="1" height="1"&gt;</description><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Programming/default.aspx">Programming</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Gotcha/default.aspx">Gotcha</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/NAV+2009+SP1/default.aspx">NAV 2009 SP1</category></item><item><title>Custom Control for Reporting Services Reports</title><link>http://www.teachmenav.com/blogs/dave/archive/2009/10/19/custom-control-for-reporting-services-reports.aspx</link><pubDate>Mon, 19 Oct 2009 09:52:00 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:90</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I recently presented a session at Intergen Dynamics Day called &lt;em&gt;Dynamics NAV 2009 &amp;ndash; a &amp;ldquo;deep dive&amp;rdquo;&lt;/em&gt; in which I showed a custom control that displayed a Graph depicting the Aged Debt for a customer. In this post, I&amp;rsquo;ll tell you a little bit about how I created this control, how to use it, and of course provide a link to the downloads. The control is free for your own use but as usual it is provided without support or warranty. Here is an example of the control linking to the Customer List (there&amp;#39;s no sound on this video but I think it illustrates the control better than a picture).&lt;/p&gt;
&lt;p&gt;(Please visit the site to view this media)&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;p&gt;The control is based upon &lt;a target="_blank" href="http://blogs.msdn.com/freddyk/archive/2009/06/07/integration-to-virtual-earth-part-4-of-4.aspx"&gt;Freddy Kristiansen&amp;rsquo;s blog post&lt;/a&gt; and sample project for integration to Virtual Earth. In Freddy&amp;rsquo;s post, he creates a custom control that uses a browser to display a web page that he modifies dynamically to show the Bing Map location of a customer. This made me think that I could pinch Freddy&amp;rsquo;s code and with a few little tweaks, create a custom control that can display any URL in a mini-browser. Initially I was going to display a PDF, as I wanted to render a NAV 2009 report as a PDF and then display it in the browser control, but I couldn&amp;rsquo;t find a way to display the PDF without the Adobe Toolbar. Then I remembered I could create a Reporting Services report and use the ReportServer to display the report with no toolbar. Perfect!&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m amazed at not only how powerful these new custom controls are, but also how easy it was to create one (thanks to Freddy&amp;rsquo;s sample).&lt;/p&gt;
&lt;p&gt;I created the control in the VPC for NAV 2009 SP1 that &lt;a target="_blank" href="http://teachmenav.com/blogs/dave/archive/2009/09/29/microsoft-dynamics-nav-2009-sp1-vpc.aspx"&gt;can be downloaded from PartnerSource&lt;/a&gt;. To use this control yourself, you first need to create the stored procedure sp_CustAgingBand. This stored procedure takes a Customer No., the Company Name (as it is converted in SQL) and the date at which the graph should be based (since it is an aged debt graph we need a date).&lt;/p&gt;
&lt;p&gt;Next, you need to deploy the Reporting Services report. You can do this by opening the Dynamics Day Reports solution and deploying to the &lt;a href="http://nav-srv-01/ReportServer"&gt;http://nav-srv-01/ReportServer&lt;/a&gt; that you&amp;rsquo;ll find on the VPC image. &lt;/p&gt;
&lt;p&gt;Then copy the URLControl.dll to the RoleTailored Client\Add-ins\ directory, and register it with a public key token of a1b0b65d07f64054. I called mine SmallURLControl.&lt;/p&gt;
&lt;p&gt;Finally, I created a new Page called Customer Aged Debt Factbox (Page 90000) that uses the custom control and modified the Customer List page (page 22) to include my new Fact Box.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve deliberately kept this post short. If you want to know about any of these parts, leave me a comment and I can make a more detailed post at a later date.&lt;/p&gt;
&lt;p&gt;You can &lt;a target="_blank" href="http://teachmenav.com/forums/p/60/89.aspx#89"&gt;download the objects from here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=90" width="1" height="1"&gt;</description><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/.NET/default.aspx">.NET</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/NAV+2009+SP1/default.aspx">NAV 2009 SP1</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Custom+Controls/default.aspx">Custom Controls</category></item><item><title>Microsoft Dynamics NAV 2009 SP1 VPC</title><link>http://www.teachmenav.com/blogs/dave/archive/2009/09/29/microsoft-dynamics-nav-2009-sp1-vpc.aspx</link><pubDate>Tue, 29 Sep 2009 08:49:03 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:82</guid><dc:creator>David Roys</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;A new virtual PC image is available for Partners to download. A PartnerSource login is required to use the &lt;a href="https://mbs.microsoft.com/partnersource/deployment/methodology/vpc/nav2009SP1.htm" target="_blank"&gt;download link page&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;I must admit that I had missed this one becoming available and am only just downloading it now. Apparently there are some new custom control examples and I’m looking forward to having a play around with these. The last VPC image had some great Web service examples including the Edit in Excel add-on that Freddy Kristiansen has been blogging about. &lt;a href="http://blogs.msdn.com/freddyk/" target="_blank"&gt;Freddy’s blog&lt;/a&gt; is a fantastic resource for NAV developers and I can recommend putting aside some time to work through some of his excellent tutorials.&lt;/p&gt;  &lt;p&gt;To keep up with the latest news and announcements on Microsoft Dynamics NAV, check out the &lt;a href="http://msdn.microsoft.com/en-us/dynamics/bb467598.aspx" target="_blank"&gt;Microsoft Dynamics Developer Center&lt;/a&gt; on MSDN.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=82" width="1" height="1"&gt;</description><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/NAV+2009+SP1/default.aspx">NAV 2009 SP1</category></item><item><title>Date format in NAV Text File Works in NAV 2009 SP1</title><link>http://www.teachmenav.com/blogs/dave/archive/2009/09/22/date-format-in-nav-text-file-works-in-nav-2009-sp1.aspx</link><pubDate>Tue, 22 Sep 2009 04:25:03 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:81</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;One of the long-standing annoyances in NAV has been that you cannot import objects from a text file that you had previously exported, if you have regional settings for time being anything other than AM PM.&lt;/p&gt;  &lt;p&gt;The previous solution was to set your local settings to USA time format (AM/PM) instead of the New Zealand (a.m./p.m.).&lt;/p&gt;  &lt;p&gt;This has now been fixed in NAV 2009 SP1 and it uses your local regional settings for the time on import as well as export.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=81" width="1" height="1"&gt;</description><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/NAV+2009+SP1/default.aspx">NAV 2009 SP1</category></item><item><title>NAV 2009 SP1 Web Services and InfoPath</title><link>http://www.teachmenav.com/blogs/dave/archive/2009/09/08/nav-2009-sp1-web-services-and-infopath.aspx</link><pubDate>Tue, 08 Sep 2009 10:02:00 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:77</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;[[Edit 090909 - After completing writing this post I discovered some problems with updating the records - I am currently working on this issue and will update the post when I have it working]]&lt;/p&gt;  &lt;p&gt;[[Edit 090909 – Yeeharr! I got it working – I had just selected the wrong element when trying to match up the submit call ]]&lt;/p&gt;  &lt;p&gt;In November of 2008 I wrote an article about using the NAV 2009 Web Services on Gaspode’s Brain Dump. This article received a lot of comments, showing how much interest this topic generates. Sadly, due to some of the limitations with NAV Web Services at that time, the example did not work as well I would have liked. The update worked for a single record (the first record) but other records did not get updated.&lt;/p&gt;  &lt;p&gt;Today I tried the same example with NAV 2009 SP1 and I’m pleased to say it all worked as planned. It’s time to re-vamp the walkthrough with a NAV 2009 SP1 feel. I’m using the NAV 2009 SP1 NZ AU release installed on my local machine using the demo option. For your own system, you will need to replace the company name with one that matches your system.&lt;/p&gt;  &lt;p&gt;Start the RoleTailored client and press Ctrl+F3 to activate the page search box and type Web Service.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_67CB993B.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_45FFC0AA.png" width="644" height="246" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Click the Web Services option to go straight to the Web Services list place. You can select the option from the drop-down list using the keyboard, but it’s a bit difficult to see what’s selected. Use the cursor-down to move into the drop down box and then move up and down through the list to the option you want. In the previous image, the Web Services list place is selected, use the cursor-right key to select the Departments Page that contains the Web Services option.&lt;/p&gt;  &lt;p&gt;Click the New button in the Action Pane and select Object Type=Page, Object ID=21, and Service Name=Customer. Don’t forget to tick the Published field to make the Web Service available.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_430A5BF7.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_0842B321.png" width="644" height="444" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;To check that your Web Service is working, enter &lt;a title="http://localhost:7047/DynamicsNAV/WS/CRONUS%20New%20Zealand%20Ltd./Page/Customer" href="http://localhost:7047/DynamicsNAV/WS/CRONUS%20New%20Zealand%20Ltd./Page/Customer"&gt;http://localhost:7047/DynamicsNAV/WS/CRONUS%20New%20Zealand%20Ltd./Page/Customer&lt;/a&gt; in to the address bar of your Internet Explorer. You should see the WSDL for the service (note that your company name is likely to be different to the one I’ve given, but at least you will be able to type the company name in as it appears in NAV and your browser will substitute %20 for the spaces in the company name.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_568795CB.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_35942324.png" width="244" height="142" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;If you don’t see the WSDL as shown previously, you should check that your Microsoft Dynamics NAV Business Web Services service is started.&lt;/p&gt;  &lt;p&gt;If you do get the WSDL, copy the URL for the Web Service from your Internet Explorer address bar, you’ll need it later on. Now it’s time to fire up InfoPath.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_0257E9BB.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_4D6AE47D.png" width="644" height="275" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;On the Getting Started page, click the option to Design a Form Template. Click on the Web Service icon as shown and click OK.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_559F0A14.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_12DFBEDC.png" width="644" height="397" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Keep the option to Receive and submit data and click Next.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_2EC0CE07.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_1A5B087C.png" width="644" height="439" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Paste the address you copied previously into the text box and click Next.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_7103C07D.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_47AC787F.png" width="644" height="439" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Click the ReadMultiple operation as the operation that will be used to provide data to the InfoPath form. Click Next to continue.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_613405AC.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_7EC5E0AB.png" width="644" height="439" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You can leave the name of the query as Main query and click Next.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_07663938.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_730073AC.png" width="244" height="167" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The next screen asks for the location of the Web Service used to submit data. Small images are shown because there’s nothing to see here. Move along. Click Next.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_58C00A88.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_1A774017.png" width="244" height="167" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now you are asked which operation is used to submit data. Select UpdateMultiple and click Next.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_2E2429AB.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_4BB604AA.png" width="644" height="439" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;On the following screen we need to specify where the list of customers needed for the submit operation will come from. With the Field or group radio button selected, click the Modify button.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_54565D36.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_789B41B8.png" width="644" height="439" /&gt;&lt;/a&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;Expand the tree control in the Select a Field or Group dialogue and highlight the ReadMultiple_Result node as shown. Click OK to continue.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_6BB78B7D.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_2B153F0E.png" width="422" height="484" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Click Next.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_4663CBA1.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_5140ACE9.png" width="244" height="167" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Leave the data connection as Main submit and click Finish.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_049C7046.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_145C054A.png" width="244" height="167" /&gt;&lt;/a&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;Hurray we have our Template to design.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_33327928.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_5C799B59.png" width="644" height="466" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Expand the query fields and click and drag the filter group on to the box that says “Drag query fields here” and select the option to add the groups as a repeating table. This way users will be able to add any filter fields to the read command. You can select the properties of these fields and set a default value - for example, Field defaults to No. and Criteria defaults to *. This will ensure you get some records back. You will also need the setSize parameter since this is mandatory for the ReadMultiple operation. Drag this on to the control surface and give it a default of 100. You should have a query section that looks something like this.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_57D36AD2.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_095ED868.png" width="644" height="143" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now expand the dataFields node and drag the Customer node on to the fields area of the design surface and once again select Repeating Table as the option. This puts in every field which is way too much so just right click on the table after you have created it and select the properties, then click the Change Binding button. You will see a tree that is expanded to show the customer node, that&amp;#39;s fine, just click Next and you&amp;#39;ll get on to a dialog where you can remove fields. For a quick way to remove all fields, click in the Columns in table list box and hold down Alt+R until there are no fields left - now you can click on the fields you want and add them. I used No, Name, Address and Phone No. You should re-size the fields so they fit the available space and have a larger Name and Address field. Now it&amp;#39;s time to run the form and see what happens. Click the Preview button. When prompted, select the option to connect rather than work offline. Hit the Run Query button and accept the dialog box and you should see something similar to the following.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_5A991FC5.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_371C7B60.png" width="463" height="719" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now the funny thing is, when I tried this at work, it worked which is why I wanted to update this blog post with the new details. Then when I got home and wrote the post, it did not work. You can imagine how happy this made me (not very). I’m wondering whether I need to be connected to the domain for this to work correctly. I’ll post more if I figure out why the results are intermittent.&lt;/p&gt;  &lt;p&gt;OK I figured out why it was not working – I had connected up the wrong node as the list of customers. Maybe this is what I did wrong prior to SP1 too? To find this I used Fiddler2 that I wrote about in the book to view the SOAP envelope of the Web service call – I could see that the call was being made but the list of customers was empty.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=77" width="1" height="1"&gt;</description><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Web+services/default.aspx">Web services</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/NAV+2009+SP1/default.aspx">NAV 2009 SP1</category></item><item><title>Option Type Parameter Values</title><link>http://www.teachmenav.com/blogs/dave/archive/2009/09/08/option-type-parameter-values.aspx</link><pubDate>Tue, 08 Sep 2009 01:27:18 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:76</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;NAV Supports various data types for parameters to functions, one of which is an Option. An option data type is stored internally as a number but will appear on screen, in reports as text. In other systems this is referred to as an enumerated type.&lt;/p&gt;  &lt;p&gt;Option type fields make it easy to write self-explanatory code, for example:&lt;/p&gt;  &lt;p&gt;&amp;quot;Purchase Header&amp;quot;.Type := &amp;quot;Purchase Header&amp;quot;.Type::Invoice;&lt;/p&gt;  &lt;p&gt;is a lot easier to understand than&lt;/p&gt;  &lt;p&gt;&amp;quot;Purchase Header&amp;quot;.Type := 2;&lt;/p&gt;  &lt;p&gt;Easier to understand means less errors in the long run.&lt;/p&gt;  &lt;p&gt;You’ve got to be careful where you use these types though. On a table field they’re great, but if you find yourself using them in a parameter to a function, take care. The system will only ensure that you are using an option type in the right place but will not check that the values in your options match. Here’s an example bit of code where the OptionString property for l_MyOptions is “Fish,Bandit,Notebook,Cheese” (don’t ask why those were the first words that sprang to mind).&lt;/p&gt;  &lt;p&gt;I I have this code in my OnRun trigger of a codeunit…&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;l_MyOptions := l_MyOptions::Fish; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;MESSAGE(&amp;#39;l_MyOptions is %1.&amp;#39;, l_MyOptions);     &lt;br /&gt;TestFunc(l_MyOptions); &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;and then create a function that takes an option parameter…&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;TestFunc(p_Option : &amp;#39;Wombat,Dog,Tasmanian Devil,Kiwi&amp;#39;)     &lt;br /&gt;MESSAGE(&amp;#39;p_Option is %1.&amp;#39;, p_Option);&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;My output looks something like this…&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_180F85BB.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_5E8C75C3.png" width="228" height="175" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_3E053611.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_16CAECDC.png" width="235" height="175" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The consequences of this are if I decide to add a new option to my parameter on my function, I need to search for every instance where I call this function to make sure I am using the same option string there. I know this because I’ve just had to do that in a modification and this is time that could have been better spent playing addictive games on Facebook.&lt;/p&gt;  &lt;p&gt;So what are the solutions? Well one way around this would be to use a field on a table to pass these values across. You can’t use table fields as parameters, but you can use records, so you could pass the entire record. This is good because a change to the option type on the table means the new options are automatically available everywhere.&lt;/p&gt;  &lt;p&gt;What would be even better, would be if we had true Extended Data Types in C/AL. The extended data type would be declare as a new object – a bit like a table. We could then use these extended data types in fields and forms. This is one feature from AX that I really miss in NAV. The advantage is that when I need to change my data type (increasing the size of an address field for example) I just change the EDT and the change gets reflected everywhere that EDT is used. Now that would really be something.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=76" width="1" height="1"&gt;</description><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Programming/default.aspx">Programming</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Gotcha/default.aspx">Gotcha</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Wish+List/default.aspx">Wish List</category></item><item><title>Microsoft Dynamics NAV 2009 SP1. Meh!</title><link>http://www.teachmenav.com/blogs/dave/archive/2009/09/06/microsoft-dynamics-nav-2009-sp1-meh.aspx</link><pubDate>Sun, 06 Sep 2009 10:11:58 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:75</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;If you got all your Christmas presents early, Christmas day would be a bit of a let down. I feel like that with NAV 2009 SP1. We got the marketing beta and got to see all of the cool things that are included and then the final release arrived and all I can say is “meh!”&lt;/p&gt;  &lt;p&gt;Don’t get me wrong, 2009 SP1 is a cool release full of lots of goodness. Some of the things in it are things that I am surprised were not there in the 2009 release (F8, Zoom, decent Matrix forms to name but a few). But there are a couple of things that are less polished than I would have liked.&lt;/p&gt;  &lt;p&gt;First of all, there is no “what’s new in NAV 2009 SP1” document. For as long as I can remember, there has always been a word document with a summary of all the new user interface features and business logic. Instead we have documentation that is jumbled up in the online help, making it impossible to see what is new at a glance.&lt;/p&gt;  &lt;p&gt;My next surprise was that you cannot run the installer for NAV 2009 SP1 without uninstalling NAV 2009 first. I haven’t seen that little feature since NAV version 4. I just copied my Microsoft Dynamics NAV folder, then uninstalled NAV 2009 and installed NAV 2009 SP1. Now I have both running side by side. Probably not supported, but why couldn’t the installer have done this for me?&lt;/p&gt;  &lt;p&gt;Then there are a bunch of things that just didn’t work as well as I wanted them to. SaveValues still does not work properly. I could kind of forgive this in the initial release but there is no excuse for not remembering my options when I run a report. Come on guys! I can copy an entire row in a journal but I can’t paste it to a new line in the journal (if this is possible as the online documentation suggests, can someone please tell me how to do it). These are backwards steps from the classic client/NAV 5.0. I am a big fan of the RoleTailored client, but these things don’t help the cause.&lt;/p&gt;  &lt;p&gt;The improvements in NAV 2009 SP1 are huge. The matrix forms are usable at last – hurray! The Menu search feature is truly awesome. The save filters option is pretty useful. The custom controls will be great if I can just think of something to do with them.&lt;/p&gt;  &lt;p&gt;All in all, this is a great release, but there’s still enough stuff missing to keep me looking forward to the next one. So when’s NAV 2009 SP2 due out? I can’t wait!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=75" width="1" height="1"&gt;</description></item><item><title>Book Review: Scratch 1.4 Beginner’s Guide</title><link>http://www.teachmenav.com/blogs/dave/archive/2009/08/25/book-review-scratch-1-4-beginner-s-guide.aspx</link><pubDate>Tue, 25 Aug 2009 10:27:39 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:72</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="400"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="200"&gt;&lt;img src="http://www.scratchguide.com/images/Scratch-Book.jpg" width="189" height="240" alt="" /&gt;&lt;/td&gt;        &lt;td valign="top" width="200"&gt;&lt;strong&gt;Author:&lt;/strong&gt; Michael Badger          &lt;br /&gt;          &lt;br /&gt;&lt;strong&gt;Publisher:&lt;/strong&gt; PACKT          &lt;br /&gt;          &lt;br /&gt;&lt;strong&gt;ISBN:&lt;/strong&gt; 978-1-847196-76-7          &lt;br /&gt;          &lt;br /&gt;&lt;strong&gt;Published:&lt;/strong&gt; July 2009&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Available from: &lt;a title="http://www.packtpub.com/scratch-1-4-beginners-guide/book/mid/130709v31a3s" href="http://www.packtpub.com/scratch-1-4-beginners-guide/book/mid/130709v31a3s"&gt;http://www.packtpub.com/scratch-1-4-beginners-guide/book/mid/130709v31a3s&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I read recently that when writing for the web, you need to get to the point quickly because ‘Generation Y’ doesn’t have time for pre-amble and nice background stuff. So here goes…&lt;/p&gt;  &lt;p&gt;If you are remotely interested in learning to program in Scratch or helping your kids learn to program in Scratch, you should buy this book. It is great.&lt;/p&gt;  &lt;p&gt;How’s that for brevity?&lt;/p&gt;  &lt;p&gt;But I’m sure if you’re genuinely interested in buying a book, you can spare more than three seconds to read someone else’s opinion before parting with your hard-earned cash. First let me tell you a little bit about Scratch.&lt;/p&gt;  &lt;p&gt;Scratch is a free programming language developed by the Lifelong Kindergarten group at the MIT Media Lab (visit &lt;a title="http://info.scratch.mit.edu/About_Scratch" href="http://info.scratch.mit.edu/About_Scratch"&gt;http://info.scratch.mit.edu/About_Scratch&lt;/a&gt; for lots more details and links to the download page – for Generation Y, assuming you are still reading, here is a link to a 30-second video giving an overview &lt;a title="http://vimeo.com/2106986" href="http://vimeo.com/2106986"&gt;http://vimeo.com/2106986&lt;/a&gt;). Scratch is fun and easy to use and a great way to learn about programming or teach programming to kids, but enough about Scratch, what about this book?&lt;/p&gt;  &lt;p&gt;The author, Michael Badger, is an experienced author and his experience definitely shines through. This book was a pleasure to read and Michael’s humour kept me amused and entertained throughout. The exercises are well-crafted and well-paced, guiding the reader through a series of tasks that gradually introduce new programming concepts and Scratch features. The concept of bugs and debugging was beautifully illustrated through a soccer-ball-heading game that resulted in some unexpected behaviour and a challenge to the reader to figure out the problem and find a solution. As always, Michael provides the solution later on in the section with a full explanation. If, on occasions, I felt lost in an exercise, the confusion was quickly cleared up in the “What just happened” section that followed. &lt;/p&gt;  &lt;p&gt;The production of this book is &lt;em&gt;nearly&lt;/em&gt; flawless and the proof reading and editing team have done a fantastic job, although I’m not sure who was responsible for the little message at the bottom of page 99: “I leaned how to use some additional markup tools in acrobat!.” My money would be on the proof reader. Oops. The fact that that was the only error I could find worth pointing out is a testament to the quality of this work.&lt;/p&gt;  &lt;p&gt;The frequent Pop quizzes are a good and, although for the most part, the questions are quite easy, on at least one occasion I would have liked a list of answers to check against rather than having to skim back over the text I had just read; but these are minor niggles and I’m sure Michael could easily put a list of answers on his &lt;a title="http://www.scratchguide.com/" href="http://www.scratchguide.com/"&gt;http://www.scratchguide.com/&lt;/a&gt; site.&lt;/p&gt;  &lt;p&gt;Reading this book won’t teach you how to write video games (at least not the sort I’m used to playing), but it is a great introduction to the world of programming and will give you the basic understanding you’ll need to get started. If you want your kids to get more from the internet than access to mindless Facebook games, YouTube video blogs, and Tweets, I recommend you give this book a go and get Scratching.&lt;/p&gt;  &lt;p&gt;I’m a big fan of Scratch and this is a fantastic book. I’m looking forward to working through the exercises once more with my daughter when she’s a little older.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=72" width="1" height="1"&gt;</description><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Book+Review/default.aspx">Book Review</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Programming/default.aspx">Programming</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Scratch/default.aspx">Scratch</category></item><item><title>User Personalization in Web services got me again!</title><link>http://www.teachmenav.com/blogs/dave/archive/2009/08/04/user-personalization-in-web-services-got-me-again.aspx</link><pubDate>Tue, 04 Aug 2009 06:58:00 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:68</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;In my last &lt;a href="http://teachmenav.com/blogs/dave/archive/2009/07/23/using-a-service-account-for-unattended-execution-of-nav-web-services-gotcha.aspx"&gt;Web service gotcha post&lt;/a&gt;, I wrote about how a User Personalisation record is needed to ensure dates are handled correctly when executing Web services. Today I discovered that if you fill in the Company field on the user personalisation, you get a whole new set of problems. My process was executing the Companies method of the SystemService Web service to get a list of companies. It was then using the list of companies to call an interface job Codeunit Web service for each company in the database.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_321C9DDE.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/image_5F00_thumb_5F00_6C979DB2.png" width="644" height="281" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;If a company is entered in to the Company field on the User Personalisation record that exists for the Windows account that the Web service is being run under, that user cannot use the Companies method to get a list of all companies. Take the company out and all is fine.&lt;/p&gt;  &lt;p&gt;I tried this out in the NAV 2009 SP1 Marketing Beta VPC and it looks like this is not an issue in SP1. I remember reading in &lt;a href="http://blogs.msdn.com/freddyk/archive/2009/05/27/web-services-changes-in-nav-2009-sp1.aspx"&gt;Freddy’s blog&lt;/a&gt; that there were some changes around a user’s default company in Web services – maybe this is what he meant.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=68" width="1" height="1"&gt;</description><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Web+services/default.aspx">Web services</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Gotcha/default.aspx">Gotcha</category></item><item><title>Programming Microsoft Dynamics NAV 2009 Book Due Out August 2009</title><link>http://www.teachmenav.com/blogs/dave/archive/2009/08/01/programming-microsoft-dynamics-nav-2009-book-due-out-august-2009.aspx</link><pubDate>Fri, 31 Jul 2009 20:39:00 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:66</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;a href="http://www.packtpub.com/programming-microsoft-dynamics-nav-2009/mid/2907099ks64d?utm_source=teachmenav.com&amp;amp;utm_medium=affiliate&amp;amp;utm_content=blog&amp;amp;utm_campaign=mdb_000066"&gt;&lt;img height="240" width="194" src="http://images.packtpub.com/images/full/1847196527.jpg" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I was on the PACKT web site the other day and I noticed that David Studebaker has written an update to his book on Programming Microsoft Dynamics NAV. I knew David was thinking about updating his book but had no idea it was so close to being finished. You can pre-order the book now by visiting &lt;a href="http://www.packtpub.com/programming-microsoft-dynamics-nav-2009/mid/2907099ks64d?utm_source=teachmenav.com&amp;amp;utm_medium=affiliate&amp;amp;utm_content=blog&amp;amp;utm_campaign=mdb_000066"&gt;the PACKT web site&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I have not read the book yet but the site blurb says that the book thoroughly covers the new features of NAV 2009, including Service Pack 1. It will be interesting to see how this book compares to his previous title &lt;a href="http://gaspodethewonderdog.blogspot.com/2007/12/book-review-programming-microsoft.html" title="http://gaspodethewonderdog.blogspot.com/2007/12/book-review-programming-microsoft.html"&gt;Programming Microsoft Dynamics NAV&lt;/a&gt; and Rene Gayer&amp;rsquo;s book &lt;a href="http://teachmenav.com/blogs/dave/archive/2009/06/28/book-review-microsoft-dynamics-nav-2009-inside.aspx" title="http://teachmenav.com/blogs/dave/archive/2009/06/28/book-review-microsoft-dynamics-nav-2009-inside.aspx"&gt;Microsoft Dynamics NAV 2009 INSIDE&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I believe there are some bundled offers that allow you to buy this book and my book together for a discounted price. The book I co-wrote with Vjeko, &lt;a href="http://www.amazon.com/dp/1847195822?tag=gassbradum-20&amp;amp;camp=14573&amp;amp;creative=327641&amp;amp;linkCode=as1&amp;amp;creativeASIN=1847195822&amp;amp;adid=1FCZT1WGJQ4Z4RVNHV4E&amp;amp;" title="1847195822-tag=gassbradum-20&amp;amp;camp=14573&amp;amp;creative=327641&amp;amp;linkCode=as1&amp;amp;creativeASIN=1847195822&amp;amp;adi"&gt;Implementing Microsoft Dynamics NAV 2009&lt;/a&gt;, was intended to be complimentary to David&amp;rsquo;s book and I think the two books will go well together. Although we cover some programming in our book and the new features in NAV 2009, we have also focused heavily on those aspects of an implementation that are not programming related, such as using a good methodology, how to design solutions, how to create functional specifications, and so on.&lt;/p&gt;
&lt;p&gt;Well done David!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=66" width="1" height="1"&gt;</description><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Programming/default.aspx">Programming</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Book+News/default.aspx">Book News</category></item><item><title>Using a Service Account for Unattended Execution of NAV Web Services - Gotcha</title><link>http://www.teachmenav.com/blogs/dave/archive/2009/07/23/using-a-service-account-for-unattended-execution-of-nav-web-services-gotcha.aspx</link><pubDate>Thu, 23 Jul 2009 00:43:00 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:65</guid><dc:creator>David Roys</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;&lt;img style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" border="0" src="http://www.et.htwk-leipzig.de/kontakte/Fechner/zeitung/usa-flagge.jpg" alt="" /&gt;&lt;/p&gt;  &lt;p&gt;If you are planning on using the new NAV 2009 Web services capabilities as a means of running scheduled tasks, you must ensure that the Windows user account that is to be used to execute the task has a User Personalisation record with the correct Language ID.&lt;/p&gt;  &lt;p&gt;5129 is the English (New Zealand) language ID and If you do not have a record, or you use the English (United States) setting then you will find date fields are validated using the US M/dd/YYYY date format. This is likely to cause you a problem if you are using the Web service to process an interface file in which you are validating a date field (such as Posting Date) with a value from a text file.&lt;/p&gt;  &lt;p&gt;I found this error, when my overnight interface processing routine was returning the error message “13/7/2009 is not a valid Posting Date”. If you are American, then you are used to your dates being backwards and will therefore be OK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=65" width="1" height="1"&gt;</description><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Web+services/default.aspx">Web services</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Gotcha/default.aspx">Gotcha</category></item><item><title>Programming from Scratch</title><link>http://www.teachmenav.com/blogs/dave/archive/2009/07/20/programming-from-scratch.aspx</link><pubDate>Mon, 20 Jul 2009 10:09:00 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:63</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I remember the first program I wrote. It was with my brother, Mike, on his Sinclair ZX81. We made a simple game in which a parachutist dropped from the sky and had to land on a platform. The platform appeared in a random position and the player could move the parachutist left and right as he dropped from the sky. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/File:Sinclair_ZX81.jpg"&gt;&lt;img height="248" width="280" src="http://upload.wikimedia.org/wikipedia/commons/thumb/3/31/Sinclair_ZX81.jpg/280px-Sinclair_ZX81.jpg" align="left" alt="Sinclair ZX81" border="0" style="border-bottom:0px;border-left:0px;margin:5px 0px;display:inline;border-top:0px;border-right:0px;" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We had fun and learnt a lot about programming. I went on to be a professional programmer and my brother went on to be a professional parachutist. Actually that last part is a lie. I&amp;#39;m not really sure what my brother does.&lt;/p&gt;
&lt;p&gt;I was reminded of these first attempts at coding when my daughter started school recently. At school they use a program called Scratch to teach programming to kids. Scratch is a free programming language that you can download from the &lt;a href="http://scratch.mit.edu/" title="http://scratch.mit.edu/"&gt;http://scratch.mit.edu/&lt;/a&gt; web site. Co-incidentally PACKT (the publishing house of my book) has just published a book entitled &lt;a href="http://83.166.169.240/scratch-1-4-beginners-guide/book/mid/130709v31a3s"&gt;Scratch 1.4: Beginner&amp;#39;s Guide&lt;/a&gt;. I figured it would be fun to download the Scratch program from the MIT web site and work through the &lt;a href="http://www.packtpub.com/article/getting-started-with-scratch-1.4-part1"&gt;two-part article/book extract&lt;/a&gt; on the PACKT article network.&lt;/p&gt;
&lt;p&gt;I was right, it was fun. I followed the examples and I had fun doing it. It took me back to the simpler times when I was a kid and there were no users, no business problems, and no deadlines.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve ordered my copy of the book and will be writing a review once I&amp;rsquo;ve read it. Now I think I&amp;rsquo;ll go back to Scratch and start work on my parachute game.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=63" width="1" height="1"&gt;</description><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Programming/default.aspx">Programming</category><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Scratch/default.aspx">Scratch</category></item><item><title>Sure Step is now available to all Partners</title><link>http://www.teachmenav.com/blogs/dave/archive/2009/07/14/sure-step-is-now-available-to-all-partners.aspx</link><pubDate>Tue, 14 Jul 2009 00:52:57 GMT</pubDate><guid isPermaLink="false">2902f03e-5b98-406b-a95e-124904271604:62</guid><dc:creator>David Roys</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;a href="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/clip_5F00_image002_5F00_754BB544.jpg"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:0px auto;display:block;float:none;border-top:0px;border-right:0px;" title="clip_image002" border="0" alt="clip_image002" src="http://www.teachmenav.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/dave/clip_5F00_image002_5F00_thumb_5F00_74DF824F.jpg" width="640" height="252" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It was announced at the Worldwide Partner Conference that the Dynamics Implementation Methodology &lt;em&gt;Sure Step &lt;/em&gt;is now available for download by all partners and not just those with a Partner Service Plan.&lt;/p&gt;  &lt;p&gt;Chapter 4: The Implementation Process focuses on using Sure Step as an implementation methodology for Dynamics NAV and provides many additional tips for a successful implementation.&lt;/p&gt;  &lt;p&gt;Learn more at &lt;b&gt;&lt;i&gt;&lt;a href="https://mbs.microsoft.com/partnersource/partneressentials/serviceplans/surestep/"&gt;PartnerSource &amp;gt; Partner Essentials &amp;gt; Sure Step&lt;/a&gt; .&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.teachmenav.com/aggbug.aspx?PostID=62" width="1" height="1"&gt;</description><category domain="http://www.teachmenav.com/blogs/dave/archive/tags/Sure+Step/default.aspx">Sure Step</category></item></channel></rss>