<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;A0YHQnY6fCp7ImA9WhVUF08.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711</id><updated>2012-05-22T19:25:33.814-04:00</updated><category term="Personal" /><category term="Quotes" /><category term="SQL Server Analysis Services" /><category term="MS Dynamics Ax 4.0" /><category term="CRM" /><category term="ASMX" /><category term="Gantt Chart" /><category term="AIF" /><category term="Office Open XML" /><category term="SQL Server" /><category term="MS Dynamics Ax 2009" /><category term="Workflow" /><category term="SharePoint 2010" /><category term="MS Dynamics CRM 2011" /><category term="Web Service" /><category term="C#" /><category term="SQL Server Reporting Services" /><category term="WCF" /><category term="MS Dynamics Ax 2012" /><category term="Software upgrade" /><category term="Axapta" /><category term="Inspiring" /><category term="Debugging" /><category term="Health and wellness" /><category term="MS Dynamics Ax BI" /><category term="Ax Enterprise Portal" /><category term="Visual Studio .Net" /><category term="MS Dynamics AX for Retail" /><title>Microsoft Dynamics AX, Microsoft Dynamics CRM, .Net, SharePoint, SSRS, SSIS - Rahul Sharma</title><subtitle type="html">This blog is for all those techies out there who are really passionate about Microsoft Dynamics AX, Microsoft Dynamics CRM, .Net, SharePoint, SSRS, SQL Server, SSIS and related technologies. Join this blog on facebook {Rahul Sharma}, to start a discussion !!!</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://blog.rahulsharma.in/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Rahul Sharma</name><uri>https://profiles.google.com/106670191477938666477</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-L5xBMIwUPQE/AAAAAAAAAAI/AAAAAAAACqU/JAg6BYx9Ssw/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>37</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Rahul-Sharma/Blog" /><feedburner:info uri="rahul-sharma/blog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>40.720666</geo:lat><geo:long>-74.005262</geo:long><link rel="license" type="text/html" href="http://creativecommons.org/licenses/by/2.0/" /><logo>http://lh3.googleusercontent.com/_RGLQxJaFYXk/TaHK0aQgVUI/AAAAAAAABw0/uxdkh7AJx74/s144/Rahul_Prof_Face.JPG</logo><feedburner:emailServiceId>Rahul-Sharma/Blog</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FRahul-Sharma%2FBlog" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FRahul-Sharma%2FBlog" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FRahul-Sharma%2FBlog" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/Rahul-Sharma/Blog" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FRahul-Sharma%2FBlog" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FRahul-Sharma%2FBlog" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FRahul-Sharma%2FBlog" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.feedburner.com%2FRahul-Sharma%2FBlog" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Ffeeds.feedburner.com%2FRahul-Sharma%2FBlog" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Ffeeds.feedburner.com%2FRahul-Sharma%2FBlog" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2FRahul-Sharma%2FBlog" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FRahul-Sharma%2FBlog" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FRahul-Sharma%2FBlog" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FRahul-Sharma%2FBlog" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:feedFlare href="http://www.wikio.com/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2FRahul-Sharma%2FBlog" src="http://www.wikio.com/shared/img/add2wikio.gif">Subscribe with Wikio</feedburner:feedFlare><feedburner:feedFlare href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Ffeeds.feedburner.com%2FRahul-Sharma%2FBlog" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><feedburner:browserFriendly>This blog is for all those techies out there who are really passionate about Microsoft Dynamics AX, Microsoft Dynamics CRM, .Net, SharePoint, SSRS, SQL Server, SSIS and related technologies. Join this blog on facebook {Rahul Sharma}, to start a discussion !!!</feedburner:browserFriendly><entry gd:etag="W/&quot;CUEAR3szfyp7ImA9WhVWGU4.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-2832304014313564715</id><published>2012-05-01T01:00:00.000-04:00</published><updated>2012-05-02T00:40:46.587-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-05-02T00:40:46.587-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2012" /><category scheme="http://www.blogger.com/atom/ns#" term="Axapta" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint 2010" /><category scheme="http://www.blogger.com/atom/ns#" term="Ax Enterprise Portal" /><title>Claims-Based Flexible Authentication in Dynamics AX 2012</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Dynamics AX 2012 provides a new way to authenticate users in AX, called &lt;b&gt;claims-based&lt;/b&gt; / &lt;b&gt;flexible authentication&lt;/b&gt;. In this approach, you don't have to create users in Active Directory first to give them access to use AX Enterprise Portal / AIF. And this is really a very nice and a way to go approach for giving AX access to external users who are not part of the organization's Active Directory structure. For example; now you are no longer required to create vendors and customers in Active Directory to have them access vendor self-service portal or customer self-service portal&amp;nbsp;respectively.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
AX&amp;nbsp;achieves this by using the concept of &lt;b&gt;trusted intermediary&lt;/b&gt;. This trusted intermediary can be anything (a website, service, or mobile app etc) that runs under the identity of a authenticated AX user account. This means that AX trusts the intermediary users or user groups and allows them to impersonate another user. In other words, the user authentication is done by trusted intermediary instead of AX. This also means that authenticated users, call into AX as trusted intermediary user and execute AX code / functionality as that authenticated user.&lt;br /&gt;
&lt;br /&gt;
On &lt;b&gt;Enterprise Portal&lt;/b&gt;, we implement this by creating a &lt;b&gt;Trusted Identity Provider&lt;/b&gt;&amp;nbsp;on&amp;nbsp;&lt;b&gt;SharePoint 2010&lt;/b&gt; that will authenticate users on behalf of AX.&lt;br /&gt;
&lt;br /&gt;
Dynamics AX 2012 introduces two new kind of user types other then&amp;nbsp;&lt;b&gt;Active Directory user&lt;/b&gt;, called&amp;nbsp;&lt;b&gt;Active Directory group&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b&gt;Claims user&lt;/b&gt;. For this post, we are dealing with Claims users only.
&lt;br /&gt;
&lt;br /&gt;
In this post, we will create a claims aware Enterprise Portal site to authenticate users by using a &lt;b&gt;forms-based authentication provider&lt;/b&gt; site. On forms-based site, users will be able to enter their credentials in a logon form. By default, Dynamics AX 2012 supports the forms-based authentication providers in ASP.NET.&lt;br /&gt;
&lt;br /&gt;
Ok, enough talking.... it's time to get hands dirty.&lt;br /&gt;
&lt;br /&gt;
Before getting started we need to make sure that following components are already installed.&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;.Net Business Connector&lt;/li&gt;
&lt;li&gt;Management utilities&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Enterprise Portal: If you have it installed then nothing needs to be done here, else, while installing make sure that you don't configure SharePoint and create website at this point, we will do it later in this post.&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;SSL certificate&lt;/span&gt;&lt;/b&gt;:&lt;br /&gt;
We need to register a Secure Sockets Layer (SSL) certificate on the Enterprise Portal Server. For now, we can create a self-signed server certificate in IIS 7.0 but for production server, you must register an SSL certificate from a certificate authority on the Enterprise Portal Server.This certificate helps to make sure that user's claim was not changed in transit.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Create a Self-Signed Server Certificate in IIS 7.0&lt;/b&gt;:&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;Open IIS Manager (command line: inetmgr) and select server or the level you want to manage.&lt;/li&gt;
&lt;li&gt;In Features view, double-click "Server Certificates".&lt;br /&gt;&lt;/li&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-aOBnzVekbNM/T1pzf1s8g6I/AAAAAAAACoY/00nqvMtQBgQ/s1600/ServerCertificates.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="280" src="http://3.bp.blogspot.com/-aOBnzVekbNM/T1pzf1s8g6I/AAAAAAAACoY/00nqvMtQBgQ/s400/ServerCertificates.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;li&gt;In the Actions pane, click "Create Self-Signed Certificate".&lt;/li&gt;
&lt;li&gt;On the "Create Self-Signed Certificate" page, type a friendly name for the certificate in the "Specify a friendly name for the certificate" box, and then click OK.&lt;br /&gt;I created mine with the name "&lt;b&gt;Rah-SelfSignedCert&lt;/b&gt;".&lt;/li&gt;
&lt;li&gt;Export it with password and save it on a file location. We will need it while registering it.&lt;br /&gt;&lt;/li&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-0aWaFTeGsa8/T1p1OvNaIxI/AAAAAAAACog/1eef8ap6YU4/s1600/ExpCert.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="156" src="http://2.bp.blogspot.com/-0aWaFTeGsa8/T1p1OvNaIxI/AAAAAAAACog/1eef8ap6YU4/s200/ExpCert.jpg" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;b&gt;Register SSL certificate on the Enterprise Portal server&lt;/b&gt;:&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;On the Windows server that will host the claims-aware Enterprise Portal site, click Start &amp;gt; Run, type mmc, and then click OK.&lt;/li&gt;
&lt;li&gt;Click File &amp;gt; Add/remove snap-in.&lt;/li&gt;
&lt;li&gt;Click Certificates, and then click Add.&lt;/li&gt;
&lt;li&gt;When the system prompts you to specify which type of account to manage certificates for, click Computer Account, and then click Next.&lt;/li&gt;
&lt;li&gt;Click Local computer, and then click Finish.&lt;/li&gt;
&lt;li&gt;In the Add or Remove Snap-ins dialog box, click OK.&lt;/li&gt;
&lt;li&gt;In the MMC snap-in, click the Certificates (Local Computer) node.&lt;/li&gt;
&lt;li&gt;Right-click Personal, and then click All tasks &amp;gt; Import. The Certificate Import Wizard opens.&lt;/li&gt;
&lt;li&gt;Click Next.&lt;/li&gt;
&lt;li&gt;Browse to the SSL certificate&amp;nbsp;
"&lt;b&gt;Rah-SelfSignedCert&lt;/b&gt;.pfx"&amp;nbsp;&amp;nbsp;for the Enterprise Portal site, and then click Next.&lt;/li&gt;
&lt;li&gt;Enter the password for the certificate, and then click Next.&lt;/li&gt;
&lt;li&gt;Select the Mark this key as exportable option, and then click Next. The Certificate Store dialog box appears.&lt;/li&gt;
&lt;li&gt;Click Next.&lt;/li&gt;
&lt;li&gt;Click Finish.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-WOv_ZAlalXQ/T1p4gJTZx3I/AAAAAAAACoo/pp4xU7JY9oY/s1600/ImportCert.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="155" src="http://4.bp.blogspot.com/-WOv_ZAlalXQ/T1p4gJTZx3I/AAAAAAAACoo/pp4xU7JY9oY/s400/ImportCert.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Create claims-aware Enterprise Portal site&lt;/span&gt;&lt;/b&gt;:&lt;br /&gt;
In this section, we will use Microsoft Dynamics AX 2012 Management Shell (Microsoft Windows PowerShell) cmdlet. This cmdlet will first creates a claims-aware web application in SharePoint and then deploys an Enterprise Portal site on that web application.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-ywE389ZmBtk/T1p7KTAAjRI/AAAAAAAACow/SliVCm8WbVY/s1600/Ax2012MngShell.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/-ywE389ZmBtk/T1p7KTAAjRI/AAAAAAAACow/SliVCm8WbVY/s320/Ax2012MngShell.jpg" width="304" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;Click Microsoft Dynamics Ax 2012 Management Shell.&lt;/li&gt;
&lt;li&gt;Execute following command.&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$Cred = Get-Credential&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;When prompted, enter the credentials of the user that you want to set up as the site administrator of the Enterprise Portal site that will be created.&lt;/li&gt;
&lt;li&gt;Execute following command, replacing “PathToSSLCertificate” with the path of the SSL certificate that you imported earlier in this post.&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$SSLCert = Get-PfxCertificate "PathToSSLCertificate"&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;On the Enterprise Portal server, execute the New-AXClaimsAwareEnterprisePortalServer cmdlet.&amp;nbsp;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;new-AXClaimsAwareEnterprisePortalServer -Credential $Cred -Port &lt;i&gt;90&lt;/i&gt; -SSLCertificate $SSLCert&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
In the above example, 90 is a port number we are using to create Enterprise Portal site though you can use any free port number. Once this command is done, you can browse the new instance of Enterprise Portal at:&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;https://ServerName:PortNumber/sites/DynamicsAx&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Forms-based authentication&lt;/span&gt;&lt;/b&gt;:&lt;br /&gt;
In this section, we will setup and create a custom authentication mechanism to authenticate external users. Forms authentication enables you to authenticate the user name and password of your users using a login form that you create. So for this, we will be creating a forms-based website and a database to hold external user credentials.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;External user credential database&lt;/b&gt;:&lt;br /&gt;
For this post, we will use ASP.NET database to store external user credentials. This database works with standard ASP.NET forms-based authentication provider. Use following command to create ASP.NET database:&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;Open a Command Prompt window by using an administrator account on the server. Execute the following command.&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regsql.exe&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;The ASP.NET SQL Server Setup Wizard opens.&lt;/li&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-ZbuUwQVw598/T1qAMNnP2pI/AAAAAAAACo4/Pe0LwgZ_eV0/s1600/aspnetdb.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="247" src="http://2.bp.blogspot.com/-ZbuUwQVw598/T1qAMNnP2pI/AAAAAAAACo4/Pe0LwgZ_eV0/s320/aspnetdb.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;li&gt;Complete the wizard. The wizard creates a new database in Microsoft SQL Server called aspnetdb if you choose &amp;lt;default&amp;gt; in database name or whatever name you give.&lt;/li&gt;
&lt;/ul&gt;
&lt;i&gt;NOTE&lt;/i&gt;: If you change the default name of the database then don't forget to change it in the web.config of forms-based provider's website as well.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Create a self-signed certificate&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
A self-signed certificate is used to establish trust between the claims-aware Enterprise Portal site and the forms-based site. The command in the following procedure creates a self-signed certificate and registers that certificate with the local computer.&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;On the Enterprise Portal server, click Start &amp;gt; All Programs.&lt;/li&gt;
&lt;li&gt;Click Microsoft Visual Studio 2010. If Visual Studio is not installed on the local server, execute the command on a server where Microsoft Visual Studio 2010 is installed, and then copy the certificate to the Enterprise Portal server.&lt;/li&gt;
&lt;li&gt;Click Visual Studio Tools &amp;gt; Visual Studio Command Prompt.&lt;/li&gt;
&lt;li&gt;Let's name this certificate as "&lt;b&gt;Rah-Forms-Cert&lt;/b&gt;".&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;makecert.exe -r -pe -a sha1 -n "CN=&lt;i&gt;Rah-Forms-Cert&lt;/i&gt;" -ss My -sr LocalMachine -sky exchange -len 2048 -sp "Microsoft Enhanced RSA and AES Cryptographic Provider" -sy 24 c:\certs\&lt;/span&gt;&lt;i style="font-family: 'Courier New', Courier, monospace;"&gt;Rah-Forms-Cert&lt;/i&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;.cer
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Create forms-based provider and register it as a claims provider in SharePoint for Enterprise Portal&lt;/b&gt;:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Click Microsoft Dynamics Ax 2012 Management Shell.&lt;/li&gt;
&lt;li&gt;Execute following command.&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$Cred = Get-Credential&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;When prompted, enter the credentials of the user that you want to set up as the site administrator of the forms-based STS site that will be created.&lt;/li&gt;
&lt;li&gt;Execute following command, replacing “PathToSSLCertificate” with the path of the SSL certificate that you imported earlier in this post.&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$SSLCert = Get-PfxCertificate "PathToSSLCertificate"&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Execute the following command.&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$SigningCert = Get-PfxCertificate c:\certs\&lt;i&gt;Rah-Forms-Cert&lt;/i&gt;.cer&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;On the Enterprise Portal server, execute the Add-AXSharepointClaimsAuthenticationProvider &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;cmdlet.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Add-AXSharepointClaimsAuthenticationProvider -Type Forms -Name &lt;i&gt;FormsAuth&lt;/i&gt; -SigningCertificate $SigningCert -Credential $Cred -Port &lt;i&gt;91&lt;/i&gt; -SSLCertificate $SSLCert&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
In the above example; our Trusted Identity Provider's name is FormsAuth and the forms-based security token service (STS) website is deployed on port 91. You can choose any name and free port.&lt;br /&gt;
&lt;br /&gt;
To make sure that we have registered the provider on our Enterprise Portal site, do following:&lt;br /&gt;
Go to SharePoint Central Administrator site &amp;gt;&amp;gt; Security &amp;gt;&amp;gt; &amp;nbsp;Manage trust, and make sure that you have FormsAuth there.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-7Blomkc23r4/T1qJSi6xbqI/AAAAAAAACpY/3fNsjy4QAdc/s1600/SPAdminMngTrust0.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="121" src="http://4.bp.blogspot.com/-7Blomkc23r4/T1qJSi6xbqI/AAAAAAAACpY/3fNsjy4QAdc/s400/SPAdminMngTrust0.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-ctR_570QRu8/T1qIEbU3jII/AAAAAAAACpA/56tVYvITjjE/s1600/SPAdminMngTrust.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="130" src="http://1.bp.blogspot.com/-ctR_570QRu8/T1qIEbU3jII/AAAAAAAACpA/56tVYvITjjE/s400/SPAdminMngTrust.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Also, go to&amp;nbsp;SharePoint Central Administrator site &amp;gt;&amp;gt; Security &amp;gt;&amp;gt; Specify authentication provider, and make sure that you have Claims Based Authentication provider registered with proper settings.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-ngdQRMWzH4Q/T1qI95mG5jI/AAAAAAAACpI/fs98VrYYl7Y/s1600/SPAdminAuthProv.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="121" src="http://3.bp.blogspot.com/-ngdQRMWzH4Q/T1qI95mG5jI/AAAAAAAACpI/fs98VrYYl7Y/s400/SPAdminAuthProv.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
The main thing is to see if it has Trusted Identity Provider set to FormsAuth.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-o9ZRiGhWGkg/T1qJDAfdg9I/AAAAAAAACpQ/4xcjKjqhmFg/s1600/TrustIdProvSet.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://3.bp.blogspot.com/-o9ZRiGhWGkg/T1qJDAfdg9I/AAAAAAAACpQ/4xcjKjqhmFg/s400/TrustIdProvSet.jpg" width="197" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;i&gt;NOTE&lt;/i&gt;: One last thing to check if you have a custom name for your ASP.NET database then you need to change the &amp;nbsp;database name in the connection string of provider's web.config as well.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-yyicaejkPpk/T1qK5IK1BxI/AAAAAAAACpg/zELewBJTj80/s1600/AXSTSChngDB.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-yyicaejkPpk/T1qK5IK1BxI/AAAAAAAACpg/zELewBJTj80/s320/AXSTSChngDB.jpg" width="180" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Create claims users&lt;/span&gt;&lt;/b&gt;:&lt;br /&gt;
Now as we have our Enterprise Portal site and forms-based site created and ready to test, it's time to create few user for testing. We need to create users first in forms-based credentials database for authentication and then in AX for giving them access to different AX modules.&lt;br /&gt;
&lt;br /&gt;
We can create our users by using &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;New-AXUser&lt;/span&gt; cmdlet of the AX Management Shell. This cmdlet will create users in both the databases. For example; below command will create a user with the name of &lt;i&gt;rahul&lt;/i&gt;, account type &lt;i&gt;Claims user&lt;/i&gt;, AXUserId &lt;i&gt;rahul&lt;/i&gt;, domain name will be the name of the claims provider we created above that is &lt;i&gt;FormsAuth&lt;/i&gt; and finally the password.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;New-AXUser -AccountType ClaimsUser -AXUserId rahul -UserName rahul -UserDomain FormsAuth -CreateInProvider -ClearTextPassword "manager@1"&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;NOTE&lt;/i&gt;: You can change password policy in the provider's web.config file.&lt;br /&gt;
&lt;br /&gt;
By default New-AXUser cmdlet adds the new user in System user role. You can assign required roles in AX if needed.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-_sDjrrf2CrQ/T1qOzneyyGI/AAAAAAAACpo/L75jzVNLYwU/s1600/AxClaimsUser.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="223" src="http://1.bp.blogspot.com/-_sDjrrf2CrQ/T1qOzneyyGI/AAAAAAAACpo/L75jzVNLYwU/s400/AxClaimsUser.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
You also need to define the relationship of this user to a AX person in system, like vendor / customer.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-WyTH26Yvp8g/T1qR0JC8nCI/AAAAAAAACqA/KrscRLKyX2g/s1600/AxUserRelation.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="230" src="http://1.bp.blogspot.com/-WyTH26Yvp8g/T1qR0JC8nCI/AAAAAAAACqA/KrscRLKyX2g/s400/AxUserRelation.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
This relationship will allow user &lt;i&gt;rahul&lt;/i&gt; to logon in to the vendor portal for vendor "Contoso Asia" as contact "Biran Groth". You can assign more then one person or vendor or customer to a single user and on Enterprise Portal you can change the role accordingly.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Grant permission to all forms-based authenticated users&lt;/b&gt;:&lt;br /&gt;
This can be&amp;nbsp;achieved&amp;nbsp;in any of the following ways:&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;Browse to SharePoint Administrator site&lt;/li&gt;
&lt;li&gt;Go to your Enterprise Portal web application&lt;/li&gt;
&lt;li&gt;Open User Policy and add Read only access for all authenticated FormsAuth users.&lt;/li&gt;
&lt;/ul&gt;
Another way to grant permission is:&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;Browse to the SharePoint Server 2010 Enterprise Portal site that you created and log on using the administrator account.&lt;/li&gt;
&lt;li&gt;On the Site Actions menu click Site Settings.&lt;/li&gt;
&lt;li&gt;In the Users and Permissions section, click Site Permissions.&lt;/li&gt;
&lt;li&gt;Click Site Name Visitors group, where Site Name is the name of the site.&lt;/li&gt;
&lt;li&gt;Click New, and then click Add Users.&lt;/li&gt;
&lt;li&gt;In the Grant Permissions window, click the browse icon.&lt;/li&gt;
&lt;li&gt;In the Select People and Groups window, click All Users, and then click All Users (FormsAuth) in the right pane.&lt;/li&gt;
&lt;li&gt;Click Add.&lt;/li&gt;
&lt;li&gt;Click OK.&lt;/li&gt;
&lt;li&gt;Verify that All Users (FormsAuth) is now part of the visitor’s group. You should now be able to log on to the SharePoint Server 2010 site with FormsAuth user’s credentials.&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;Test functionality&lt;/b&gt;:&lt;br /&gt;
Now if you go to the Dynamics AX Enterprise Portal URL (https://ServerName:PortNumber/sites/DynamicsAx), the Sign In page will prompt you to select a logon option in a drop-down list. In our setup URL will be,&amp;nbsp;https://ServerName:&lt;i&gt;90&lt;/i&gt;/sites/DynamicsAx&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-3gMDU-mgh54/T1qQU6sAChI/AAAAAAAACpw/cDM5zfJb1yA/s1600/AxClaimsSignInPage.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="160" src="http://1.bp.blogspot.com/-3gMDU-mgh54/T1qQU6sAChI/AAAAAAAACpw/cDM5zfJb1yA/s400/AxClaimsSignInPage.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
If you select FormsAuth, you will be redirected to the forms-based authentication logon site.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-g2SLxmMJV14/T1qQ4mlTv-I/AAAAAAAACp4/laflgxN6vrE/s1600/AxClaimsSignInPage1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="295" src="http://1.bp.blogspot.com/-g2SLxmMJV14/T1qQ4mlTv-I/AAAAAAAACp4/laflgxN6vrE/s400/AxClaimsSignInPage1.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
After sign in, depending on the roles of that user in AX, you will be redirected to the Enterprise Portal. In our case, user only has vendor portal roles assigned for one vendor. If user has more than one relationship defined then he can navigate from one role to another on Enterprise Portal itself.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-CSk9poq4rsI/T1qTGEgk-iI/AAAAAAAACqI/ROtpRmd-0Fc/s1600/AxVendorPortal1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="307" src="http://1.bp.blogspot.com/-CSk9poq4rsI/T1qTGEgk-iI/AAAAAAAACqI/ROtpRmd-0Fc/s400/AxVendorPortal1.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: There can be instances where instead of having Vendor credential database, organization can decide to go with having a&amp;nbsp;separate Active Directory for vendors. For this, same concept can be used where you will setup Active Directory Federation Services instead of Forms-based authentication.&lt;br /&gt;
&lt;br /&gt;
That's it for today. Next time we will see how to use this concept with AIF where you can access AIF service using claims user.&lt;br /&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Join me on &lt;a href="http://fb.rahulsharma.in/" target="_blank"&gt;facebook &lt;/a&gt; and feel free to post your comments / feedback / queries.&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-2832304014313564715?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=oU1eQ_LOVzs:pXizlVdZb-Y:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=oU1eQ_LOVzs:pXizlVdZb-Y:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=oU1eQ_LOVzs:pXizlVdZb-Y:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=oU1eQ_LOVzs:pXizlVdZb-Y:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=oU1eQ_LOVzs:pXizlVdZb-Y:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=oU1eQ_LOVzs:pXizlVdZb-Y:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=oU1eQ_LOVzs:pXizlVdZb-Y:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/oU1eQ_LOVzs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/2832304014313564715/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2012/05/claims-based-flexible-authentication-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/2832304014313564715?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/2832304014313564715?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/oU1eQ_LOVzs/claims-based-flexible-authentication-in.html" title="Claims-Based Flexible Authentication in Dynamics AX 2012" /><author><name>Rahul Sharma</name><uri>https://profiles.google.com/106670191477938666477</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-L5xBMIwUPQE/AAAAAAAAAAI/AAAAAAAACqU/JAg6BYx9Ssw/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-aOBnzVekbNM/T1pzf1s8g6I/AAAAAAAACoY/00nqvMtQBgQ/s72-c/ServerCertificates.jpg" height="72" width="72" /><thr:total>0</thr:total><georss:featurename>Jersey City, NJ 07304, USA</georss:featurename><georss:point>40.7160913 -74.0740729</georss:point><georss:box>40.6920203 -74.11355490000001 40.7401623 -74.0345909</georss:box><feedburner:origLink>http://blog.rahulsharma.in/2012/05/claims-based-flexible-authentication-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkICR3k5eyp7ImA9WhVSFE0.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-1495742234563278860</id><published>2012-03-09T18:54:00.000-05:00</published><updated>2012-03-10T12:29:26.723-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-03-10T12:29:26.723-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics AX for Retail" /><category scheme="http://www.blogger.com/atom/ns#" term="Axapta" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio .Net" /><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server" /><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2009" /><title>Dynamics AX for Retail POS Development - Code Samples</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
In this post, I am going to share some .Net POS code samples to get you going with Retail POS coding.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Sample POS C# code&lt;/span&gt;:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;1) How to fetch POS data?&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Though you can use any .Net data access technology but POS provides helper classes to make things simpler.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Text;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Data;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Data.SqlClient;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; LSRetailPosis.DataAccess;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; LSRetailPosis.DataAccess.DataUtil;&lt;/pre&gt;
&lt;pre class="alt"&gt; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Rahul.Dynamics.Retail.DataAccess&lt;/pre&gt;
&lt;pre class="alt"&gt;{&lt;/pre&gt;
&lt;pre&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; PosIsButtonGrid : DataLayer&lt;/pre&gt;
&lt;pre class="alt"&gt;    {&lt;/pre&gt;
&lt;pre&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; PosIsButtonGrid(SqlConnection connection, &lt;span class="kwrd"&gt;string&lt;/span&gt; DATAAREAID) &lt;/pre&gt;
&lt;pre class="alt"&gt;            : &lt;span class="kwrd"&gt;base&lt;/span&gt;(connection, DATAAREAID)&lt;/pre&gt;
&lt;pre&gt;        {&lt;/pre&gt;
&lt;pre class="alt"&gt;        }&lt;/pre&gt;
&lt;pre&gt; &lt;/pre&gt;
&lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; DataTable GetPosIsButtonGridById(&lt;span class="kwrd"&gt;string&lt;/span&gt; BUTTONGRIDID)&lt;/pre&gt;
&lt;pre&gt;        {&lt;/pre&gt;
&lt;pre class="alt"&gt;            SqlSelect sqlUtilSelect = &lt;span class="kwrd"&gt;new&lt;/span&gt; SqlSelect(&lt;span class="str"&gt;"POSISBUTTONGRID"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;            sqlUtilSelect.Select(&lt;span class="str"&gt;"BUTTONGRIDID"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre class="alt"&gt;            sqlUtilSelect.Select(&lt;span class="str"&gt;"NAME"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;            sqlUtilSelect.Where(&lt;span class="str"&gt;"DATAAREAID"&lt;/span&gt;, &lt;span class="kwrd"&gt;base&lt;/span&gt;.dataAreaId, &lt;span class="kwrd"&gt;true&lt;/span&gt;);&lt;/pre&gt;
&lt;pre class="alt"&gt;            sqlUtilSelect.Where(&lt;span class="str"&gt;"BUTTONGRIDID"&lt;/span&gt;, BUTTONGRIDID, &lt;span class="kwrd"&gt;false&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;base&lt;/span&gt;.dbUtil.GetTable(sqlUtilSelect);&lt;/pre&gt;
&lt;pre class="alt"&gt;        }&lt;/pre&gt;
&lt;pre&gt; &lt;/pre&gt;
&lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; DataTable GetPosIsButtonGridButtonsByGridId(&lt;span class="kwrd"&gt;string&lt;/span&gt; BUTTONGRIDID)&lt;/pre&gt;
&lt;pre&gt;        {&lt;/pre&gt;
&lt;pre class="alt"&gt;            SqlSelect sqlUtilSelect = &lt;span class="kwrd"&gt;new&lt;/span&gt; SqlSelect(&lt;span class="str"&gt;"POSISBUTTONGRIDBUTTONS"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;            sqlUtilSelect.Select(&lt;span class="str"&gt;"DISPLAYTEXT"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre class="alt"&gt;            sqlUtilSelect.Select(&lt;span class="str"&gt;"ACTIONPROPERTY"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;            sqlUtilSelect.Where(&lt;span class="str"&gt;"DATAAREAID"&lt;/span&gt;, &lt;span class="kwrd"&gt;base&lt;/span&gt;.dataAreaId, &lt;span class="kwrd"&gt;true&lt;/span&gt;);&lt;/pre&gt;
&lt;pre class="alt"&gt;            sqlUtilSelect.Where(&lt;span class="str"&gt;"BUTTONGRIDID"&lt;/span&gt;, BUTTONGRIDID, &lt;span class="kwrd"&gt;false&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;            sqlUtilSelect.OrderBy(&lt;span class="str"&gt;"ROWNUMBER"&lt;/span&gt;, &lt;span class="kwrd"&gt;true&lt;/span&gt;);&lt;/pre&gt;
&lt;pre class="alt"&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;base&lt;/span&gt;.dbUtil.GetTable(sqlUtilSelect);&lt;/pre&gt;
&lt;pre&gt;        }&lt;/pre&gt;
&lt;pre class="alt"&gt;    }&lt;/pre&gt;
&lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;2) How to show a dialog box?&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; (LSRetailPosis.POSProcesses.frmMessage dialog = &lt;span class="kwrd"&gt;new&lt;/span&gt; LSRetailPosis.POSProcesses.frmMessage("Rahul", MessageBoxButtons.OK, MessageBoxIcon.Error))&lt;/pre&gt;
&lt;pre&gt;{&lt;/pre&gt;
&lt;pre class="alt"&gt;         LSRetailPosis.POSProcesses.POSFormsManager.ShowPOSForm(dialog);&lt;/pre&gt;
&lt;pre&gt;} &lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;3) Add an item to the current sales transaction.&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="rem"&gt;//Sale item. Add it to retail transaction&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; ItemSale(&lt;span class="kwrd"&gt;ref&lt;/span&gt; PosTransaction posTransaction, &lt;span class="kwrd"&gt;string&lt;/span&gt; itemID, &lt;span class="kwrd"&gt;decimal&lt;/span&gt; quantity)&lt;/pre&gt;
&lt;pre class="alt"&gt;        {&lt;/pre&gt;
&lt;pre&gt;            &lt;span class="rem"&gt;// If the transaction object is not of the type RetailTransaction, it has to be converted to one before an item can be added&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (posTransaction.GetType() != &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(RetailTransaction))&lt;/pre&gt;
&lt;pre&gt;            {&lt;/pre&gt;
&lt;pre class="alt"&gt;                posTransaction = &lt;span class="kwrd"&gt;new&lt;/span&gt; RetailTransaction(LSRetailPosis.Settings.ApplicationSettings.Terminal.StoreId, LSRetailPosis.Settings.ApplicationSettings.Terminal.StoreCurrency, LSRetailPosis.Settings.ApplicationSettings.Terminal.TaxIncludedInPrice, LSRetailPosis.ApplicationServices.IRounding);&lt;/pre&gt;
&lt;pre&gt;                TransactionSystem transSystem = &lt;span class="kwrd"&gt;new&lt;/span&gt; TransactionSystem(posTransaction);&lt;/pre&gt;
&lt;pre class="alt"&gt;                transSystem.LoadTransactionStatus();&lt;/pre&gt;
&lt;pre&gt;            }&lt;/pre&gt;
&lt;pre class="alt"&gt; &lt;/pre&gt;
&lt;pre&gt; &lt;span class="kwrd"&gt;try&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;            {&lt;/pre&gt;
&lt;pre&gt;                &lt;span class="kwrd"&gt;string&lt;/span&gt; selectedItemId = itemID;&lt;/pre&gt;
&lt;pre class="alt"&gt;                &lt;span class="rem"&gt;//if (ApplicationServices.IItem.ItemSearch(ref selectedItemId, 500))&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;                {&lt;/pre&gt;
&lt;pre class="alt"&gt;                    ItemSystem system = &lt;span class="kwrd"&gt;new&lt;/span&gt; ItemSystem((RetailTransaction)posTransaction);&lt;/pre&gt;
&lt;pre&gt;                    &lt;span class="kwrd"&gt;string&lt;/span&gt; selectedBarcodeId = &lt;span class="str"&gt;""&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class="alt"&gt;                    DataTable barcodesForItem = system.GetBarcodesForItem(selectedItemId);&lt;/pre&gt;
&lt;pre&gt;                    &lt;span class="kwrd"&gt;if&lt;/span&gt; (barcodesForItem == &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;pre class="alt"&gt;                    {&lt;/pre&gt;
&lt;pre&gt;                        selectedBarcodeId = &lt;span class="str"&gt;""&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class="alt"&gt;                    }&lt;/pre&gt;
&lt;pre&gt;                    &lt;span class="kwrd"&gt;else&lt;/span&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt; (barcodesForItem.Rows.Count == 0)&lt;/pre&gt;
&lt;pre class="alt"&gt;                    {&lt;/pre&gt;
&lt;pre&gt;                        selectedBarcodeId = &lt;span class="str"&gt;""&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class="alt"&gt;                    }&lt;/pre&gt;
&lt;pre&gt;                    &lt;span class="kwrd"&gt;else&lt;/span&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt; (barcodesForItem.Rows.Count == 1)&lt;/pre&gt;
&lt;pre class="alt"&gt;                    {&lt;/pre&gt;
&lt;pre&gt;                        selectedBarcodeId = barcodesForItem.Rows[0][0].ToString();&lt;/pre&gt;
&lt;pre class="alt"&gt;                    }                        &lt;/pre&gt;
&lt;pre&gt;                    &lt;/pre&gt;
&lt;pre class="alt"&gt;                    &lt;span class="kwrd"&gt;if&lt;/span&gt; (selectedBarcodeId.Length != 0)&lt;/pre&gt;
&lt;pre&gt;                    {&lt;/pre&gt;
&lt;pre class="alt"&gt;                        OperationInfo o = &lt;span class="kwrd"&gt;new&lt;/span&gt; OperationInfo();&lt;/pre&gt;
&lt;pre&gt;                        o.NumpadQuantity = 1;&lt;/pre&gt;
&lt;pre class="alt"&gt;                        o.NumpadValue = selectedBarcodeId;&lt;/pre&gt;
&lt;pre&gt; o.ReturnItems = &lt;span class="kwrd"&gt;false&lt;/span&gt;;                        &lt;/pre&gt;
&lt;pre class="alt"&gt; &lt;/pre&gt;
&lt;pre&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; ItemSale { OperationID = PosisOperations.ItemSale, OperationInfo = o, Barcode = selectedBarcodeId, POSTransaction = posTransaction }.RunOperation();&lt;/pre&gt;
&lt;pre class="alt"&gt;                    }&lt;/pre&gt;
&lt;pre&gt;                    &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;                    {&lt;/pre&gt;
&lt;pre&gt;                        OperationInfo o = &lt;span class="kwrd"&gt;new&lt;/span&gt; OperationInfo();&lt;/pre&gt;
&lt;pre class="alt"&gt;                        o.NumpadQuantity = 1;&lt;/pre&gt;
&lt;pre&gt;                        o.NumpadValue = selectedItemId;&lt;/pre&gt;
&lt;pre class="alt"&gt;                        o.ReturnItems = &lt;span class="kwrd"&gt;false&lt;/span&gt;;&lt;/pre&gt;
&lt;pre&gt; &lt;/pre&gt;
&lt;pre class="alt"&gt;                        &lt;span class="kwrd"&gt;new&lt;/span&gt; ItemSale { OperationID = PosisOperations.ItemSale, OperationInfo = o, Barcode = selectedItemId, POSTransaction = posTransaction }.RunOperation();&lt;/pre&gt;
&lt;pre&gt;                    }&lt;/pre&gt;
&lt;pre class="alt"&gt;                }&lt;/pre&gt;
&lt;pre&gt;            }&lt;/pre&gt;
&lt;pre class="alt"&gt;            &lt;span class="kwrd"&gt;catch&lt;/span&gt; (PosisException exception)&lt;/pre&gt;
&lt;pre&gt;            {&lt;/pre&gt;
&lt;pre class="alt"&gt;                &lt;span class="kwrd"&gt;using&lt;/span&gt; (LSRetailPosis.POSProcesses.frmMessage dialog = &lt;span class="kwrd"&gt;new&lt;/span&gt; LSRetailPosis.POSProcesses.frmMessage(exception.Message, MessageBoxButtons.OK, MessageBoxIcon.Error))&lt;/pre&gt;
&lt;pre&gt;                {&lt;/pre&gt;
&lt;pre class="alt"&gt;                    LSRetailPosis.POSProcesses.POSFormsManager.ShowPOSForm(dialog);&lt;/pre&gt;
&lt;pre&gt;                }&lt;/pre&gt;
&lt;pre class="alt"&gt;                ApplicationExceptionHandler.HandleException(&lt;span class="str"&gt;"BlankOperation.ItemSale"&lt;/span&gt;, exception);&lt;/pre&gt;
&lt;pre&gt;                &lt;span class="kwrd"&gt;throw&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class="alt"&gt;            }&lt;/pre&gt;
&lt;pre&gt;            &lt;span class="kwrd"&gt;catch&lt;/span&gt; (Exception exception2)&lt;/pre&gt;
&lt;pre class="alt"&gt;            {&lt;/pre&gt;
&lt;pre&gt;                &lt;span class="kwrd"&gt;using&lt;/span&gt; (LSRetailPosis.POSProcesses.frmMessage dialog = &lt;span class="kwrd"&gt;new&lt;/span&gt; LSRetailPosis.POSProcesses.frmMessage(exception2.Message, MessageBoxButtons.OK, MessageBoxIcon.Error))&lt;/pre&gt;
&lt;pre class="alt"&gt;                {&lt;/pre&gt;
&lt;pre&gt;                    LSRetailPosis.POSProcesses.POSFormsManager.ShowPOSForm(dialog);&lt;/pre&gt;
&lt;pre class="alt"&gt;                }&lt;/pre&gt;
&lt;pre&gt;                ApplicationExceptionHandler.HandleException(&lt;span class="str"&gt;"BlankOperation.ItemSale"&lt;/span&gt;, exception2);&lt;/pre&gt;
&lt;pre class="alt"&gt;                &lt;span class="kwrd"&gt;throw&lt;/span&gt;;&lt;/pre&gt;
&lt;pre&gt;            }&lt;/pre&gt;
&lt;pre class="alt"&gt;        }&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;References:&lt;/b&gt;&lt;br /&gt;
&lt;a href="http://blog.rahulsharma.in/2011/09/dynamics-ax-for-retail-pos-development.html"&gt;Dynamics AX for Retail POS Development&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Join me on &lt;a href="http://fb.rahulsharma.in/" target="_blank"&gt;facebook &lt;/a&gt; and feel free to post your comments / feedback / queries.&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-1495742234563278860?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=rkQac09ut3c:QtyTdYRVNss:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=rkQac09ut3c:QtyTdYRVNss:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=rkQac09ut3c:QtyTdYRVNss:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=rkQac09ut3c:QtyTdYRVNss:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=rkQac09ut3c:QtyTdYRVNss:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=rkQac09ut3c:QtyTdYRVNss:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=rkQac09ut3c:QtyTdYRVNss:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/rkQac09ut3c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/1495742234563278860/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2011/09/dynamics-ax-for-retail-pos-development_17.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/1495742234563278860?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/1495742234563278860?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/rkQac09ut3c/dynamics-ax-for-retail-pos-development_17.html" title="Dynamics AX for Retail POS Development - Code Samples" /><author><name>Rahul Sharma</name><uri>https://profiles.google.com/106670191477938666477</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-L5xBMIwUPQE/AAAAAAAAAAI/AAAAAAAACqU/JAg6BYx9Ssw/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.rahulsharma.in/2011/09/dynamics-ax-for-retail-pos-development_17.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkcNRHY-cCp7ImA9WhdVE0o.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-5393960339340741652</id><published>2011-09-17T13:45:00.002-04:00</published><updated>2011-09-18T16:34:55.858-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-18T16:34:55.858-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics AX for Retail" /><category scheme="http://www.blogger.com/atom/ns#" term="Axapta" /><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2009" /><title>Dynamics AX for Retail POS Development</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
This article is a kick start for customizing AX for Retail POS. We will see how we can modify or create new touch screen forms, operations &amp;amp; tables in POS system. At the end, you will also see some code samples that will also give you the feeling of how code looks in POS.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Prerequisite:&lt;/i&gt;&lt;/b&gt;&amp;nbsp;You must know how to write C# assemblies, SQL Queries and X++.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.blogger.com/blogger.g?blogID=2122347489242910711" name="more"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.microsoft.com/en-us/dynamics/products/ax-retail.aspx"&gt;Dynamics AX for Retail&lt;/a&gt; is a retail software that integrates point of sale (POS), retail store management, and ERP all in one solution. I am assuming you all understand how it works (atleast from functional point of view).  It's implementation includes four separate applications.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1) Dynamics AX for Retail Headquarters&lt;/b&gt; is managed and implemented in AX. It is designed to run at the head office. It has three modules in AX.&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;&lt;i&gt;Retail Headquarters module&lt;/i&gt; is used to configure and manage stores, terminals, staff, retail items, promotions, gift cards, retail sales transactions and other records.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Retail Scheduler module&lt;/i&gt; is used to synchronize data between head office (AX) and stores / terminals.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Retail Store Inventory&lt;/i&gt; is used to send store inventory documents to stores to use for receiving inventory for a purchase order, picking or receiving inventory for a transfer order, or counting stock for a count order.&lt;br /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;2) Dynamics AX for Retail POS&lt;/b&gt; is a .Net touch screen application having its own local database to work offline during network interruptions. This can be fully customized for any type of business and store procedures. This is what we are going to cover in this article.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;3) Dynamics AX for Retail Store Connect&lt;/b&gt; is a windows service that sends data between the head office, stores and individual POS terminals.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;4) Dynamics AX for Retail Transaction Service&lt;/b&gt; is again a windows service that is also a part of communication mechanism of Dynamics AX for Retail. For example; this service is used to authenticate the cashier logon credentials etc.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Customize Retail POS&lt;/b&gt;: After going through this article you should be able to modify or extend existing POS functionality.&lt;br /&gt;
&lt;br /&gt;
In order to customize the POS, you need to &lt;b&gt;download the Microsoft Dynamics AX for Retail POS Plug-ins&lt;/b&gt;. These plug-ins are available on Microsoft Dynamics &lt;a href="http://www.microsoft.com/dynamics/en/au/partner-login.aspx"&gt;PartnerSource&lt;/a&gt; or &lt;a href="http://www.microsoft.com/dynamics/customer/en-us/access-customersource/default.aspx"&gt;CustomerSource&lt;/a&gt; website.&lt;br /&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-4KxowR6woBs/TmZaMrzvjxI/AAAAAAAACQA/zqkWmj9ez40/s1600/POSPlugInFolders.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-4KxowR6woBs/TmZaMrzvjxI/AAAAAAAACQA/zqkWmj9ez40/s1600/POSPlugInFolders.JPG" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="font-size: 13px; text-align: center;"&gt;Plug-ins folder structure.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
When you download plug-ins you will get C# source code for services and triggers as well as the required documentation. Download also comes with a some .Net tutorials and a developer's guide to customization.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Services&lt;/b&gt;: Services are actually .Net assemblies. POS implements many of the features as services using interfaces and can be modified using Visual Studio 2008. POS loads these services at run time by calling the interfaces. So whenever you modify or extend the standard service keep the assembly name same as original so that POS can recognize it and call it at run time.&lt;br /&gt;
&lt;br /&gt;
Each service provides a specific feature in POS. There is a special service called Blank service. This service can be used to implement custom operations and can be invoked using the Blank operation.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;NOTE&lt;/b&gt;&lt;/i&gt;: You can modify or develop new business logic or new touch screen forms when talking about customizing the POS. Logic is written in C# and should not be a big thing for a C# developer. In order to create touch screens Microsoft uses third party controls from &lt;a href="http://www.devexpress.com/Products/NET/Controls/WinForms/"&gt;DevExpress&lt;/a&gt;. You need buys a license of a specific version &lt;b&gt;(9.2.109.0) of DXperience WinForms&lt;/b&gt;&amp;nbsp;for Retail April Refresh R2.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Triggers&lt;/b&gt;: Triggers are called before and after the operations. There are two types of triggers, Pre-triggers and Post-triggers. Pre-triggers provide a way of validation before a certain operation is executed. Post-triggers are used to respond to an operation after it has finished. You can modify the triggers same way as services.&lt;br /&gt;
&lt;br /&gt;
Below are the tasks we going to perform in this session to customize POS.&lt;br /&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Create a new table in POS that already exists in AX. POS database is actually a slimmed down version of AX database. All the POS tables also exists in AX as well.&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Create the required table in AX first then just open the SQL Server Management Studio and copy the Create SQL Script for this table. Now, go to your POS database (AxRetailPOS) and run this script to get the exact schema as your AX table. We need to keep table schema same at both side for data synch.&lt;br /&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Write AX Retail Scheduler job to synch data between AX and POS database.&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;You will use AX Retail Scheduler module to setup data synchronize jobs. AX uses these jobs to synch data between POS terminal and AX headquarters.&lt;br /&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Create an operation and POS button in Button Grid (Tasks) in AX. Attach your operation with the button.&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;You define your custom operation in AX which is then linked to a POS button. All custom operations are handled through the Blank operation.  &lt;/span&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-COXn904x43o/TmZr34tiUsI/AAAAAAAACQE/5RwFRpwtW3E/s1600/POSHQSetup.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-COXn904x43o/TmZr34tiUsI/AAAAAAAACQE/5RwFRpwtW3E/s320/POSHQSetup.JPG" width="145" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="font-size: 13px; text-align: center;"&gt;AX &amp;gt; Retail Headquarters &amp;gt; Setup&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-nlcXrkTynbo/TmZwF2nbnsI/AAAAAAAACQI/Jc-Yd2fYsf8/s1600/POSBtnGrid.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="248" src="http://1.bp.blogspot.com/-nlcXrkTynbo/TmZwF2nbnsI/AAAAAAAACQI/Jc-Yd2fYsf8/s400/POSBtnGrid.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Define a button on button grip.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-UoyNzFbipvU/TmZ0tDgUIYI/AAAAAAAACQM/gr5RYWbd2eQ/s1600/POSBtnGrid1.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="238" src="http://2.bp.blogspot.com/-UoyNzFbipvU/TmZ0tDgUIYI/AAAAAAAACQM/gr5RYWbd2eQ/s400/POSBtnGrid1.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Set operation id to Blank Operation.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-tsV2niNYyT0/TmZ0wo4-abI/AAAAAAAACQQ/DMksNQWFeVc/s1600/POSBtnGrid2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="256" src="http://3.bp.blogspot.com/-tsV2niNYyT0/TmZ0wo4-abI/AAAAAAAACQQ/DMksNQWFeVc/s400/POSBtnGrid2.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Right click to set button attributes.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-ZkACobUToFc/TmZ1ZkILd3I/AAAAAAAACQU/13ganIUh9gI/s1600/POSBtnGrid3.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="390" src="http://2.bp.blogspot.com/-ZkACobUToFc/TmZ1ZkILd3I/AAAAAAAACQU/13ganIUh9gI/s400/POSBtnGrid3.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Define properties you will see in BlankOperations.dll&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;When you click on this blank operation bound POS button, at run time POS calls Blank operations service (BlankOperations.dll). You can modify this service and check if it's been called with operation attributes you provided in AX.&lt;br /&gt;
&lt;br /&gt;
Blank operations service (BlankOperations.dll) can be modified from the "&lt;i&gt;Retail POS Plug-ins\Services\BlankOperations"&lt;/i&gt; folder. For this, create a .Net C# Class Library project for this folder and do required modification for your custom operation. This Blank operation service only contains one class called BlankOperations. This class only has one method,&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; BlankOperation(&lt;span class="kwrd"&gt;ref&lt;/span&gt; BlankOperationInfo operationInfo, &lt;span class="kwrd"&gt;ref&lt;/span&gt; PosTransaction posTransaction)&lt;/pre&gt;
&lt;br /&gt;
operationInfo provides operation details like OperationId (Operation number), Parameter (Blank operation param) etc. posTransaction is your current retail transaction.&lt;br /&gt;
&lt;br /&gt;
After you are done compile your project and replace original BlankOperations.dll in all POS installations (Services folder) with your modified BlankOperations.dll.&lt;br /&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Create a new POS plugin to show touch form to fill data. This plugin will be called from the button you added above.&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;By now you know that plug-ins are .Net assemblies. You can create one for your custom functionality and put it in the Services folder. You can then call it from the BlankOperations.dll and check if this service is called by your custom button. To create touch forms you need &lt;b&gt;DXperience WinForms &lt;/b&gt;&lt;b&gt;(9.2.109.0)&lt;/b&gt; license and knowledge of .Net windows form development&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;
That's it for now. Do let me know if I missed something or you want me to add more things specific to POS development?&lt;br /&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Join me on &lt;a href="http://fb.rahulsharma.in/" target="_blank"&gt;facebook &lt;/a&gt; and feel free to post your comments / feedback / queries.&lt;/div&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-5393960339340741652?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=5pbhcXiPRcQ:3ELlwKhdtog:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=5pbhcXiPRcQ:3ELlwKhdtog:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=5pbhcXiPRcQ:3ELlwKhdtog:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=5pbhcXiPRcQ:3ELlwKhdtog:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=5pbhcXiPRcQ:3ELlwKhdtog:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=5pbhcXiPRcQ:3ELlwKhdtog:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=5pbhcXiPRcQ:3ELlwKhdtog:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/5pbhcXiPRcQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/5393960339340741652/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2011/09/dynamics-ax-for-retail-pos-development.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/5393960339340741652?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/5393960339340741652?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/5pbhcXiPRcQ/dynamics-ax-for-retail-pos-development.html" title="Dynamics AX for Retail POS Development" /><author><name>Rahul Sharma</name><uri>https://profiles.google.com/106670191477938666477</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-L5xBMIwUPQE/AAAAAAAAAAI/AAAAAAAACqU/JAg6BYx9Ssw/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-4KxowR6woBs/TmZaMrzvjxI/AAAAAAAACQA/zqkWmj9ez40/s72-c/POSPlugInFolders.JPG" height="72" width="72" /><thr:total>4</thr:total><georss:featurename>United States</georss:featurename><georss:point>37.09024 -95.71289100000001</georss:point><georss:box>10.70899 -156.97250350000002 63.47149 -34.45327850000001</georss:box><feedburner:origLink>http://blog.rahulsharma.in/2011/09/dynamics-ax-for-retail-pos-development.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcFSXszfyp7ImA9WhdWF0g.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-3538472949786097475</id><published>2011-09-11T10:39:00.000-04:00</published><updated>2011-09-11T10:40:18.587-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-11T10:40:18.587-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics CRM 2011" /><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server Reporting Services" /><category scheme="http://www.blogger.com/atom/ns#" term="CRM" /><title>Upload of Fetch-Xml report fails with VB Code - Dynamics CRM</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
This is a quick reference to keep things in mind while writing VB code on Fetch-Xml based SSRS reports. You need to avoid using below functions otherwise you wont be able to upload your reports to Dynamics CRM Online.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
Currently these are the &lt;b&gt;Namespaces &lt;/b&gt;allowed for you to use in your VB code:&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Microsoft.VisualBasic.Interaction&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Microsoft.VisualBasic.information&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Microsoft.VisualBasic.strings&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Microsoft.VisualBasic.DateInterval&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Microsoft.VisualBasic.dateandtime&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Microsoft.VisualBasic.conversion&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;System.String&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;System.Object&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;System.Datetime&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;System.Timespan&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;System.Math&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;System.DbNull&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;System.Globalization.CultureInfo&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;System.Text.RegularExpressions.Regex&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;System.Text.RegularExpressions.Match&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
In these Namespace following&lt;b&gt; functions &lt;/b&gt;are &lt;b&gt;denied&lt;/b&gt;:&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Acos, Add, Addition, AddMilliseconds, AddMonths, AddSeconds, AddTicks, AddYears, AppActivate, Asin, Atan2, Beep, BigMul, CacheSize, CallByName, capnames, caps, capsize, capslist, Ceiling, Choose, Command, Compare, CompareTo, CompileToAssembly, Cosh, CreateObject, DateString, DayOfWeek, DayOfYear, Days, DaysInMonth, DeleteSetting, DivRem, Duration, E, Empty, Environ, Equality, Equals, Erl, Err, ErrorToString, Escape, factory, Filter, Finalize, Finalize, Fix, FromBinary, FromDays, FromFileTime, FromFileTimeUtc, FromHours, FromMilliseconds, FromMinutes, FromOADate, FromSeconds, FromTicks, GetAllSettings, GetChar, GetDateTimeFormats, GetGroupNames, GetGroupNumbers, GetHashCode, GetObject, GetSetting, GetType, GetTypeCode, GreaterThan, GreaterThanOrEqual, GroupNameFromNumber, GroupNumberFromName, Hours, IConvertible.ToBoolean, IConvertible.ToByte, IConvertible.ToChar, IConvertible.ToDateTime, IConvertible.ToDecimal, IConvertible.ToDouble, IConvertible.ToInt16, IConvertible.ToInt32, IConvertible.ToInt64, IConvertible.ToSByte, IConvertible.ToSingle, IConvertible.ToType, IConvertible.ToUInt16, IConvertible.ToUInt32, IConvertible.ToUInt64, IEEERemainder, InitializeReferences, InputBox, Int, IRR, IsDaylightSavingTime, IsDBNull, Iserializable.GetObjectData, IsError, IsLeapYear, IsMatch, Kind, Lbound, Lset, Matches, MaxValue, MemberwiseClone, Millisecond, Milliseconds, Minutes, MinValue, MIRR, MsgBox, Negate, NextMatch, NPV, Options, Parse, ParseExact, pattern, PI, Pow, ReferenceEquals, Result, RightToLeft, roptions, Rset, SaveSetting, Seconds, Shell, Sinh, SpecifyKind, Subtract, Subtraction, Switch, Synchronized, SystemTypeName, Tanh, TicksPerDay, TicksPerHour, TicksPerMillisecond, TicksPerMinute, TicksPerSecond, Timer, TimeString, ToBinary, ToFileTime, ToFileTimeUtc, ToLocalTime, ToLongDateString, ToLongTimeString, ToOADate, ToShortTimeString, TotalDays, TotalHours, TotalMilliseconds, TotalMinutes, ToUniversalTime, Truncate, TryParse, TryParseExact, Ubound, Unescape, UseOptionC, UseOptionR, VbTypeName, Zero&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So, if you are having problem uploading Fetch-Xml reports to CRM Online then it might be a good starting point for debugging.&lt;br /&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Follow this blog on &lt;a href="http://fb.rahulsharma.in/" target="_blank"&gt;facebook &lt;/a&gt; and feel free to post your comments / feedback / queries.&lt;/div&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-3538472949786097475?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=_R28m-ebVwQ:KGNX4q6ycAg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=_R28m-ebVwQ:KGNX4q6ycAg:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=_R28m-ebVwQ:KGNX4q6ycAg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=_R28m-ebVwQ:KGNX4q6ycAg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=_R28m-ebVwQ:KGNX4q6ycAg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=_R28m-ebVwQ:KGNX4q6ycAg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=_R28m-ebVwQ:KGNX4q6ycAg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/_R28m-ebVwQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/3538472949786097475/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2011/09/upload-of-fetch-xml-report-fails-with.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/3538472949786097475?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/3538472949786097475?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/_R28m-ebVwQ/upload-of-fetch-xml-report-fails-with.html" title="Upload of Fetch-Xml report fails with VB Code - Dynamics CRM" /><author><name>Rahul Sharma</name><uri>https://profiles.google.com/106670191477938666477</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-L5xBMIwUPQE/AAAAAAAAAAI/AAAAAAAACqU/JAg6BYx9Ssw/s512-c/photo.jpg" /></author><thr:total>0</thr:total><georss:featurename>107 Kensington Ave, Jersey City, NJ 07304, USA</georss:featurename><georss:point>40.7236536 -74.0765405</georss:point><georss:box>40.7221496 -74.07900799999999 40.725157599999996 -74.074073</georss:box><feedburner:origLink>http://blog.rahulsharma.in/2011/09/upload-of-fetch-xml-report-fails-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcAR3kyfSp7ImA9WhZaGU0.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-2587939880254628178</id><published>2011-07-05T17:31:00.004-04:00</published><updated>2011-07-05T17:40:46.795-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-05T17:40:46.795-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Axapta" /><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2009" /><title>Add new Context Menu in AOT to Browse Table with Grid Toolbar - Dynamics AX</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;In this article we will see how we can extend Dynamics AX table browser to have standard grid toolbar like all other Dynamics AX forms.&amp;nbsp;We will also create a new context menu in &lt;i&gt;AOT &amp;gt; Data dictionary &amp;gt; Table &amp;gt; Add-Ins,&lt;/i&gt;&amp;nbsp;called "Table browser - Advance", which will show us our advanced table browser and the default Table browser context menu command will show standard table browser as usual.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
This is how our advance table browser will look like:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-q_yqLN6Yu7M/ThN3Drn2a6I/AAAAAAAACCs/9mfig7kqiaM/s1600/TableBrowser.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="381" src="http://2.bp.blogspot.com/-q_yqLN6Yu7M/ThN3Drn2a6I/AAAAAAAACCs/9mfig7kqiaM/s400/TableBrowser.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Our context menu will look like this:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-BVbBk7je21A/ThN3r4PNX0I/AAAAAAAACCw/bUKNJqixIAs/s1600/TableBrowserCntxtMnu.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://4.bp.blogspot.com/-BVbBk7je21A/ThN3r4PNX0I/AAAAAAAACCw/bUKNJqixIAs/s400/TableBrowserCntxtMnu.jpg" width="241" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The AX project with all the modifications (&lt;b&gt;bold&lt;/b&gt; nodes) we need to do can be found at the end of the post.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-90Urh_InMKk/ThN6dQUlgKI/AAAAAAAACC0/ILbUOTTxKd0/s1600/AdvTableBrowserProj.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" src="http://2.bp.blogspot.com/-90Urh_InMKk/ThN6dQUlgKI/AAAAAAAACC0/ILbUOTTxKd0/s640/AdvTableBrowserProj.jpg" width="235" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;SysTableBrowser&lt;/b&gt; class contains&amp;nbsp;necessary modifications to handle toolbar display and related code.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;RahSysTableBrowser&lt;/b&gt; display menu item points to SysTableBrowser class such that it can be used to call with advance options.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;SysContextMenu&lt;/b&gt; class contains validation to display our menu item only for tables and views.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;SysContextMenu &lt;/b&gt;menu handles the Add-Ins context menu.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Code&lt;/b&gt;:&lt;br /&gt;
&lt;a href="https://docs.google.com/leaf?id=0B0Yu1ptgrzAYOTY0OWQ0ODItZWMxMC00MzVhLWJiOTYtMTU2OWU4Yzg0ZGNk&amp;amp;hl=en_US" target="_blank"&gt;Download&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Join me on &lt;a href="http://fb.rahulsharma.in/" target="_blank"&gt;facebook &lt;/a&gt; and feel free to post your comments / feedback / queries.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-2587939880254628178?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=eBoLS-sCnng:1zxFci8LcP0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=eBoLS-sCnng:1zxFci8LcP0:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=eBoLS-sCnng:1zxFci8LcP0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=eBoLS-sCnng:1zxFci8LcP0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=eBoLS-sCnng:1zxFci8LcP0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=eBoLS-sCnng:1zxFci8LcP0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=eBoLS-sCnng:1zxFci8LcP0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/eBoLS-sCnng" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/2587939880254628178/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2011/07/add-new-context-menu-in-aot-to-browse.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/2587939880254628178?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/2587939880254628178?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/eBoLS-sCnng/add-new-context-menu-in-aot-to-browse.html" title="Add new Context Menu in AOT to Browse Table with Grid Toolbar - Dynamics AX" /><author><name>Rahul Sharma</name><uri>https://profiles.google.com/106670191477938666477</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-L5xBMIwUPQE/AAAAAAAAAAI/AAAAAAAACqU/JAg6BYx9Ssw/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-q_yqLN6Yu7M/ThN3Drn2a6I/AAAAAAAACCs/9mfig7kqiaM/s72-c/TableBrowser.jpg" height="72" width="72" /><thr:total>0</thr:total><georss:featurename>United States</georss:featurename><georss:point>37.09024 -95.71289100000001</georss:point><georss:box>10.70899 -156.97250350000002 63.47149 -34.45327850000001</georss:box><feedburner:origLink>http://blog.rahulsharma.in/2011/07/add-new-context-menu-in-aot-to-browse.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0ICQHkyeCp7ImA9WhZUFUs.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-9090409022962038357</id><published>2011-06-06T16:33:00.002-04:00</published><updated>2011-06-08T16:39:21.790-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-08T16:39:21.790-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Axapta" /><category scheme="http://www.blogger.com/atom/ns#" term="Debugging" /><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2009" /><category scheme="http://www.blogger.com/atom/ns#" term="AIF" /><title>Change File Ownership through X++ in Dynamics AX</title><content type="html">&lt;p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;This article shows a little trick that might be needed for testing AX AIF file adapter based integration. We all know that how frustrating it can be to setup input file ownership to current AX user while testing otherwise AX will complain about it. &lt;br /&gt;
&lt;br /&gt;
Here is a small static function with filepath as a parameter. This function will set current AX user as the owner of the input file. This function can be called right before the call to &lt;i&gt;fileSystem.ReadFile(filePath)&lt;/i&gt; in \Classes\AifFileSystemReceiveAdapter\readFile.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;static&lt;/span&gt; client &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; SetFileOwnership2CurUser(FilePath _filePath)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    UserInfo                                            userInfo;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    System.IO.FileInfo                                  fileInfo;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    System.Security.AccessControl.FileSecurity          fileSecurity;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    System.Security.Principal.SecurityIdentifier        sid;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    System.Security.AccessControl.AccessControlSections acSections;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    ;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    &lt;span class="rem"&gt;//select current user&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;    select userInfo&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        &lt;span class="kwrd"&gt;where&lt;/span&gt; userInfo.Id == curuserid();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;    &lt;span class="kwrd"&gt;try&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;        &lt;span class="kwrd"&gt;new&lt;/span&gt; InteropPermission(InteropKind::ClrInterop).assert();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;        fileInfo           = &lt;span class="kwrd"&gt;new&lt;/span&gt; System.IO.FileInfo(_filePath);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;        acSections      = System.Security.AccessControl.AccessControlSections::Owner;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        fileSecurity       = fileInfo.GetAccessControl(acSections);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;        sid = &lt;span class="kwrd"&gt;new&lt;/span&gt; System.Security.Principal.SecurityIdentifier(userInfo.sid);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;        &lt;span class="rem"&gt;//set ownership&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;        fileSecurity.SetOwner(sid);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;        fileInfo.SetAccessControl(fileSecurity);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;        CodeAccessPermission::revertAssert();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;    &lt;span class="kwrd"&gt;catch&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;        &lt;span class="kwrd"&gt;throw&lt;/span&gt; error(AifUtil::getClrErrorMessage());&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
Join me on&amp;nbsp;&lt;a href="http://fb.rahulsharma.in/" target="_blank"&gt;facebook&amp;nbsp;&lt;/a&gt;and feel free to post your comments / feedback / queries.&lt;/div&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-9090409022962038357?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=xBzhibpeTCw:82qN-kMMaBM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=xBzhibpeTCw:82qN-kMMaBM:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=xBzhibpeTCw:82qN-kMMaBM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=xBzhibpeTCw:82qN-kMMaBM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=xBzhibpeTCw:82qN-kMMaBM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=xBzhibpeTCw:82qN-kMMaBM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=xBzhibpeTCw:82qN-kMMaBM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/xBzhibpeTCw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/9090409022962038357/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2011/06/change-file-ownership-through-x-in_06.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/9090409022962038357?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/9090409022962038357?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/xBzhibpeTCw/change-file-ownership-through-x-in_06.html" title="Change File Ownership through X++ in Dynamics AX" /><author><name>Rahul Sharma</name><uri>https://profiles.google.com/106670191477938666477</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-L5xBMIwUPQE/AAAAAAAAAAI/AAAAAAAACqU/JAg6BYx9Ssw/s512-c/photo.jpg" /></author><thr:total>0</thr:total><georss:featurename>CANAL STREET, NY 10013, USA</georss:featurename><georss:point>40.7203421 -74.0079781</georss:point><georss:box>40.71293360000001 -74.0215471 40.7277506 -73.9944091</georss:box><feedburner:origLink>http://blog.rahulsharma.in/2011/06/change-file-ownership-through-x-in_06.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcERXwyeyp7ImA9WhZUEU4.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-2435255443664886019</id><published>2011-06-03T17:36:00.000-04:00</published><updated>2011-06-03T17:36:44.293-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-03T17:36:44.293-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Axapta" /><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2009" /><title>Modify Dynamics AX Standard Excel Import to Include - Update existing records - rule</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Sometimes we need to import an excel file that contains existing and new records. With standard Dynamics AX 2009 you don't get an option (import rule) where you can specify ONLY import and update existing records. Below are standard AX excel import rules...&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-Z9s-Z0tVFIQ/Ta3jaowiqoI/AAAAAAAABx4/EiaE1e5dpmU/s1600/ImportExcelRules.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="146" src="http://4.bp.blogspot.com/-Z9s-Z0tVFIQ/Ta3jaowiqoI/AAAAAAAABx4/EiaE1e5dpmU/s400/ImportExcelRules.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
To add a rule that says "Update existing records" only.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Modify Enum SysDataExcelImportRule&lt;/b&gt; to add a new element for update.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-98ZWZ3LSupo/Ta3kmNXe9rI/AAAAAAAABx8/CPMlO3APAKM/s1600/ImportExcelRulesEnum.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="138" src="http://3.bp.blogspot.com/-98ZWZ3LSupo/Ta3kmNXe9rI/AAAAAAAABx8/CPMlO3APAKM/s400/ImportExcelRulesEnum.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;i&gt;Note: If you noticed I have inserted new Enum element with value 101, which is far away what Microsoft is using. It is a best practice to keep some difference between the enum values, so if Microsoft inserts new standard enum elements later then our custom enum element do not overlap with the standard. It helps when you upgrade your AX system in future.&lt;/i&gt;&amp;nbsp;&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;Modify Class SysDataImportExcel&lt;/b&gt;, method ImportData as stated below. Just add lines having related modification comments.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;    &lt;span class="kwrd"&gt;switch&lt;/span&gt; (importRule)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;        &lt;span class="rem"&gt;//#N by Rahul Sharma on 19Apr2011 for RAH_ExcelImportRule_UpdateOnlyOption&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;        &lt;span class="rem"&gt;//added update only option&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;        &lt;span class="kwrd"&gt;case&lt;/span&gt; SysDataExcelImportRule::RAHUpdate :&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;        &lt;span class="kwrd"&gt;case&lt;/span&gt; SysDataExcelImportRule::InsertAndUpdate :&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;            selectForUpdate = &lt;span class="kwrd"&gt;true&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        &lt;span class="kwrd"&gt;case&lt;/span&gt; SysDataExcelImportRule::InsertNew :&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;            updCommon = &lt;span class="kwrd"&gt;this&lt;/span&gt;.recordExist(_dictTable, _curcommon, selectForUpdate);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;            &lt;span class="kwrd"&gt;break&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    }&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (updCommon.RecId)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;        &lt;span class="rem"&gt;//existing standard code&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;        &lt;span class="rem"&gt;//#N by Rahul Sharma on 19Apr2011 for RAH_ExcelImportRule_UpdateOnlyOption&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;        &lt;span class="rem"&gt;//break if its a new record&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (importRule == SysDataExcelImportRule::RAHUpdate)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;false&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;        &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        selectForUpdate = &lt;span class="kwrd"&gt;false&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;        updCommon = _curcommon;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;    }&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
After these small changes, you now should be able to import and update only existing records using standard AX excel import.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-3JeUCatf8C8/Ta3nC5KFvaI/AAAAAAAAByA/ttq777HFTYM/s1600/ImportExcelRules2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="202" src="http://4.bp.blogspot.com/-3JeUCatf8C8/Ta3nC5KFvaI/AAAAAAAAByA/ttq777HFTYM/s400/ImportExcelRules2.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
You can download the AX Project from here.&lt;br /&gt;
&lt;iframe frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://cid-0e75794c17db3f50.office.live.com/embedicon.aspx/blog.rahulsharma.in/SharedProject^_RAH^_ExcelImportRule^_UpdateOnlyOption.xpo" style="background-color: #fcfcfc; height: 115px; padding: 0; width: 98px;" title="Preview"&gt;&lt;/iframe&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Join me on &lt;a href="http://fb.rahulsharma.in/" target="_blank"&gt;facebook &lt;/a&gt; and feel free to post your comments / feedback / queries.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-2435255443664886019?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=_UEVIubqDUc:mYzMu48G3aw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=_UEVIubqDUc:mYzMu48G3aw:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=_UEVIubqDUc:mYzMu48G3aw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=_UEVIubqDUc:mYzMu48G3aw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=_UEVIubqDUc:mYzMu48G3aw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=_UEVIubqDUc:mYzMu48G3aw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=_UEVIubqDUc:mYzMu48G3aw:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/_UEVIubqDUc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/2435255443664886019/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2011/06/modify-dynamics-ax-standard-excel.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/2435255443664886019?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/2435255443664886019?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/_UEVIubqDUc/modify-dynamics-ax-standard-excel.html" title="Modify Dynamics AX Standard Excel Import to Include - Update existing records - rule" /><author><name>Rahul Sharma</name><uri>https://profiles.google.com/106670191477938666477</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-L5xBMIwUPQE/AAAAAAAAAAI/AAAAAAAACqU/JAg6BYx9Ssw/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-Z9s-Z0tVFIQ/Ta3jaowiqoI/AAAAAAAABx4/EiaE1e5dpmU/s72-c/ImportExcelRules.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.rahulsharma.in/2011/06/modify-dynamics-ax-standard-excel.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE4ARHs6fCp7ImA9WhZUEE4.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-2987510602616445814</id><published>2011-06-02T13:14:00.005-04:00</published><updated>2011-06-02T13:49:05.514-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-02T13:49:05.514-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2012" /><category scheme="http://www.blogger.com/atom/ns#" term="Debugging" /><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2009" /><title>Write into the System Event Viewer from Dynamics AX</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;This is a very short article which shows how to write any information into the system event viewer. This is&amp;nbsp;something that can be very useful when trying to debug processes such as batches that are difficult to debug. One thing to note is that if the code is running on the AOS the information will be written to the EventViewer on the AOS, just something to keep in mind if you don’t see your message in the EventViewer.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; writeEventLogEntry(Args _args)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    System.Diagnostics.EventLog eventlog;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    #Define.LogSource(&lt;span class="str"&gt;"Dynamics AX"&lt;/span&gt;)&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    #Define.LogName(&lt;span class="str"&gt;"Application"&lt;/span&gt;) &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    ;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    &lt;span class="rem"&gt;// check if the log already exists&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt;(!System.Diagnostics.EventLog::SourceExists(#LogSource))&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;        &lt;span class="rem"&gt;// create new log&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        System.Diagnostics.EventLog::CreateEventSource(#LogSource, #LogName);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt; &lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;    eventlog = &lt;span class="kwrd"&gt;new&lt;/span&gt; System.Diagnostics.EventLog();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    eventlog.set_Source(#LogSource);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt; &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;    &lt;span class="rem"&gt;// write info entry&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;    eventlog.WriteEntry(&lt;span class="str"&gt;"&amp;lt;Info&amp;gt;: Just writing in the event viewer."&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;    &lt;span class="rem"&gt;// write error entry&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;    eventlog.WriteEntry(&lt;span class="str"&gt;"&amp;lt;Error&amp;gt;: Please check the stack trace below. \n\n"&lt;/span&gt; + &lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;con2str(xSession::xppCallStack()), System.Diagnostics.EventLogEntryType::Error);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;    &lt;span class="rem"&gt;// write warning entry&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;    eventlog.WriteEntry(&lt;span class="str"&gt;"Job finished."&lt;/span&gt; , System.Diagnostics.EventLogEntryType::Warning);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
Hope this possibly helps someone down the road somewhere!.&lt;br /&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Join me on &lt;a href="http://fb.rahulsharma.in/" target="_blank"&gt;facebook &lt;/a&gt; and feel free to post your comments / feedback / queries.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;See also:&lt;/b&gt;&lt;br /&gt;
&lt;a href="http://blog.rahulsharma.in/2009/12/get-ms-dynamics-ax-call-stack-in-x-code.html"&gt;Get MS Dynamics Ax Call Stack in X++ Code&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-2987510602616445814?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=DFlZnT_FKY8:IG_VSpVm58E:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=DFlZnT_FKY8:IG_VSpVm58E:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=DFlZnT_FKY8:IG_VSpVm58E:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=DFlZnT_FKY8:IG_VSpVm58E:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=DFlZnT_FKY8:IG_VSpVm58E:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=DFlZnT_FKY8:IG_VSpVm58E:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=DFlZnT_FKY8:IG_VSpVm58E:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/DFlZnT_FKY8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/2987510602616445814/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2011/06/write-into-system-event-viewer-from.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/2987510602616445814?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/2987510602616445814?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/DFlZnT_FKY8/write-into-system-event-viewer-from.html" title="Write into the System Event Viewer from Dynamics AX" /><author><name>Rahul Sharma</name><uri>https://profiles.google.com/106670191477938666477</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-L5xBMIwUPQE/AAAAAAAAAAI/AAAAAAAACqU/JAg6BYx9Ssw/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.rahulsharma.in/2011/06/write-into-system-event-viewer-from.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C04DQ307cCp7ImA9WhZXFkQ.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-277614733365338924</id><published>2011-05-04T12:33:00.004-04:00</published><updated>2011-05-06T10:26:12.308-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-06T10:26:12.308-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2009" /><title>Install Microsoft Dynamics AX 2009 SP1 on Windows 7</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I know this post is a bit late as we are already about to see release of AX 2012 soon, but for a long time I wanted to put this information together for some of you guys who were continuously asking me to do this. &lt;br /&gt;
&lt;br /&gt;
So, many of us use VPC for AX demo and exploration because it has all the required components already in place. But it requires you to have enough memory to run your host OS and VPC at the same time, it also slows down your system. If you don’t have enough free memory then it will even refuse to load.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
This article is for those who want to install AX on their laptop, so that they don’t have to wait for VPC to start (or wake up from hibernation) and at the same time want to maintain the system performance at its best.&lt;br /&gt;
&lt;br /&gt;
Here are the steps to install local AX 2009 SP1 on your laptop running Windows 7 OS.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Dynamics AX Basic Installation:&lt;/b&gt;&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;&lt;li&gt;Make sure you are logged in through your domain account (domain\user) on your laptop, not local system account.&lt;/li&gt;
&lt;li&gt;You should have local admin rights on your laptop.&lt;/li&gt;
&lt;li&gt;Install SQL Server 2008 with SP1. Service account for this should be local system.&lt;/li&gt;
&lt;li&gt;Install AX 2009. You need to be connected to your domain while installing AX. Ignore warning that says this operating system is not supported.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;AOS again should run under local system, instead of your domain account. Because this way you can use AX when you are out of your domain network.&lt;br /&gt;
Hint: At the time of installation select Network service and after successful installation convert AOS service account to Local System.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-gARjrVJ0P3s/TcF_TnXlqgI/AAAAAAAAB1c/7mEW7jrugis/s1600/Ax5AosSelectAccount.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="203" src="http://1.bp.blogspot.com/-gARjrVJ0P3s/TcF_TnXlqgI/AAAAAAAAB1c/7mEW7jrugis/s400/Ax5AosSelectAccount.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;On the next screen, uncheck checkbox which says start AOS after installation.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-WbnsS6sQUMw/TcF_YgpyYlI/AAAAAAAAB1g/_SMIQDG9zRQ/s1600/Ax5AosCheckBox.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="256" src="http://3.bp.blogspot.com/-WbnsS6sQUMw/TcF_YgpyYlI/AAAAAAAAB1g/_SMIQDG9zRQ/s400/Ax5AosCheckBox.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;Click Install and you are done with the basic AX 2009 installation.&lt;/li&gt;
&lt;li&gt;To get it running with SQL Server 2008 SP1, you need AX 2009 SP1.&lt;/li&gt;
&lt;li&gt;Install AX 2009 SP1.&lt;/li&gt;
&lt;li&gt;Start AOS. (Optional: you may need to change the AOS service account to Local System).&lt;/li&gt;
&lt;li&gt;In AX, AdministratorSetupSecuritySystem service account, Set BC Proxy Account to your domain account (user , domain.com).&lt;/li&gt;
&lt;li&gt;Import Demo Data.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;b&gt;Dynamics AX Role Center &amp;amp; Enterprise Portal Installation:&lt;/b&gt;&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;&lt;li&gt;EP needs Sharepoint portal to be installed on your laptop. To install WSS / MOSS on your Windows 7 OS follow this link. &lt;a href="http://community.bamboosolutions.com/blogs/bambooteamblog/archive/2009/05/07/installing-wss-3-0-moss-sp2-on-windows-7-rc.aspx"&gt;Install Sharepoint on Windows 7&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Once you have installed &amp;amp; configured Sharepoint, install Role center &amp;amp; Enterprise portal from the AX installation CD. It will run fine; I have checked it on my laptop.&lt;/li&gt;
&lt;li&gt;If you have Visual Studio 2008 installed, then you can also install enterprise portal development tools.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;b&gt;Dynamics AX Workflow:&lt;/b&gt;&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;&lt;li&gt;Just install this component, it will also be installed without error. Just ignore any warning you see.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;b&gt;Dynamics AX SQL Reporting Services:&lt;/b&gt;&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;&lt;li&gt;You can deploy reports to your reporting server without any error. Make sure SSRS service account is local system.&lt;/li&gt;
&lt;li&gt;I am having some difficulty running AX SSRS reports. I will update you all once this part is also done.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
I hope this information will help you guys.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Join me on &lt;a href="http://fb.rahulsharma.in/" target="_blank"&gt;facebook &lt;/a&gt; and feel free to post your comments / feedback / queries.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-277614733365338924?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=PB34KXSNSHY:8YR_MGN4h7o:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=PB34KXSNSHY:8YR_MGN4h7o:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=PB34KXSNSHY:8YR_MGN4h7o:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=PB34KXSNSHY:8YR_MGN4h7o:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=PB34KXSNSHY:8YR_MGN4h7o:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=PB34KXSNSHY:8YR_MGN4h7o:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=PB34KXSNSHY:8YR_MGN4h7o:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/PB34KXSNSHY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/277614733365338924/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2011/05/install-microsoft-dynamics-ax-2009-sp1.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/277614733365338924?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/277614733365338924?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/PB34KXSNSHY/install-microsoft-dynamics-ax-2009-sp1.html" title="Install Microsoft Dynamics AX 2009 SP1 on Windows 7" /><author><name>Rahul Sharma</name><uri>https://profiles.google.com/106670191477938666477</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-L5xBMIwUPQE/AAAAAAAAAAI/AAAAAAAACqU/JAg6BYx9Ssw/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-gARjrVJ0P3s/TcF_TnXlqgI/AAAAAAAAB1c/7mEW7jrugis/s72-c/Ax5AosSelectAccount.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.rahulsharma.in/2011/05/install-microsoft-dynamics-ax-2009-sp1.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A04MQX04fSp7ImA9WhZQFks.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-9182805238127184442</id><published>2011-04-22T11:24:00.003-04:00</published><updated>2011-04-24T14:33:00.335-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-24T14:33:00.335-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2012" /><category scheme="http://www.blogger.com/atom/ns#" term="Axapta" /><title>Microsoft Dynamics AX 2012 Book - Unleashed, SAMS</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://www.amazon.com/Microsoft-Dynamics-AX-2012-Unleashed/dp/0672335484/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1303484304&amp;amp;sr=8-1" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;" target="_blank"&gt;&lt;img border="0" height="200" src="http://1.bp.blogspot.com/-ppX5tX-zCao/TbGb5MAeupI/AAAAAAAAByE/MIVIrxP8Iic/s200/AX2012Unleashed.jpg" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Dynamics AX 2012 lovers,&amp;nbsp;I am really excited to share this with you that we are coming up with the first book on Dynamics AX 2012.&amp;nbsp;This book is a complete reference guide for functional and technical consultants. I am proudly a co-author of many of the technical chapters in this book with my other best in the industry colleagues.&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
You can now pre-order your copy of &lt;a href="http://www.amazon.com/Microsoft-Dynamics-AX-2012-Unleashed/dp/0672335484/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1303484304&amp;amp;sr=8-1" target="_blank"&gt;Microsoft Dynamics AX 2012 Unleashed&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Join me on &lt;a href="http://fb.rahulsharma.in/" target="_blank"&gt;facebook &lt;/a&gt; and feel free to post your comments / feedback / queries.&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-9182805238127184442?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=lpk3PsA_2hc:cur_xAOz4E4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=lpk3PsA_2hc:cur_xAOz4E4:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=lpk3PsA_2hc:cur_xAOz4E4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=lpk3PsA_2hc:cur_xAOz4E4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=lpk3PsA_2hc:cur_xAOz4E4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=lpk3PsA_2hc:cur_xAOz4E4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=lpk3PsA_2hc:cur_xAOz4E4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/lpk3PsA_2hc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/9182805238127184442/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2011/04/microsoft-dynamics-ax-2012-unleashed.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/9182805238127184442?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/9182805238127184442?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/lpk3PsA_2hc/microsoft-dynamics-ax-2012-unleashed.html" title="Microsoft Dynamics AX 2012 Book - Unleashed, SAMS" /><author><name>Rahul Sharma</name><uri>https://profiles.google.com/106670191477938666477</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-L5xBMIwUPQE/AAAAAAAAAAI/AAAAAAAACqU/JAg6BYx9Ssw/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-ppX5tX-zCao/TbGb5MAeupI/AAAAAAAAByE/MIVIrxP8Iic/s72-c/AX2012Unleashed.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.rahulsharma.in/2011/04/microsoft-dynamics-ax-2012-unleashed.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0IAQ3s7cSp7ImA9WhZUF04.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-4294539178563844396</id><published>2011-04-14T15:40:00.003-04:00</published><updated>2011-06-10T15:52:22.509-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-10T15:52:22.509-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics CRM 2011" /><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server Reporting Services" /><category scheme="http://www.blogger.com/atom/ns#" term="CRM" /><title>Microsoft Dynamics CRM 2011 Fetch XML based Custom Reports</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;a href="http://crm.dynamics.com/en-us" target="_blank"&gt;Microsoft Dynamics CRM 2011&lt;/a&gt; comes in two flavors, &lt;a href="http://crm.dynamics.com/en-us/on-demand" target="_blank"&gt;online&lt;/a&gt; and &lt;a href="http://crm.dynamics.com/en-us/on-premises" target="_blank"&gt;on-premises&lt;/a&gt;. Fetch-Xml method of report development can be used to create custom SSRS reports for both the types of CRM deployments.
&lt;br /&gt;
&lt;br /&gt;
To get started with the development, make sure you have installed the below two pieces of software:
&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;- &lt;a href="http://www.microsoft.com/sqlserver/2008/en/us/business-intelligence.aspx" target="_blank"&gt;SQL Server 2008 R2 Business Intelligence Development Studio (BIDS)&lt;/a&gt;. Installing BIDS will also install Visual Studio 2008 cut down version to develop SSRS reports.&lt;br /&gt;
&lt;br /&gt;
- &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=64a09b75-8376-4b9d-aea3-8a83a1837c4d" target="_blank"&gt;Microsoft Dynamics CRM 2011 Fetch Authoring Extension&lt;/a&gt;&amp;nbsp;for BIDS. This will give you ability to add Microsoft Dynamics CRM Fetch data source in your SSRS report. To configure this data source for your report you need to provide CRM Server URL, Organisation Unique Name and Windows Live Credentials or Domain\LoginId.&lt;br /&gt;
&lt;br /&gt;
By installing and configuring the Fetch XML data source, creating a report is as simple as creating a normal SSRS report except rather than choosing Microsoft SQL Server as your data source you chose Microsoft Dynamics CRM Fetch as your report data source.
&lt;br /&gt;
&lt;br /&gt;
These CRM reports are regular RDLs with Fetch XML as the data query language and the data provider is &lt;i&gt;MSCRMFETCH&lt;/i&gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;There are two ways to create custom CRM reports&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;First&lt;/i&gt; option is you create a basic report through &lt;i&gt;CRM Report Wizard&lt;/i&gt; and then download RDL to modify it in BIDS. The Report wizard creates fetch-xml based reports and this can be a good starting point to learn or start developing your fetch-xml based reports.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Second&lt;/i&gt;, you can &lt;i&gt;create fetch-xml report&lt;/i&gt; from scratch in BIDS.&lt;br /&gt;
&lt;br /&gt;
In this article, we will see how to create fetch-xml based reports from the scratch in BIDS.&lt;br /&gt;&lt;br /&gt;
&lt;h2&gt;&lt;span style="font-size: medium;"&gt;Create Fetch-XML Report:&lt;/span&gt;&lt;/h2&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;Launch Business Intelligence Development Studio.&lt;/li&gt;
&lt;li&gt;Create a new Report Server Project.&lt;/li&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-o_e5D2pC0RE/TaNn54sd3DI/AAAAAAAABw8/kNYt0YD1V1k/s1600/FetchXmlVSNewProject.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="285" src="http://3.bp.blogspot.com/-o_e5D2pC0RE/TaNn54sd3DI/AAAAAAAABw8/kNYt0YD1V1k/s400/FetchXmlVSNewProject.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;li&gt;In Solution Explorer, right-click Reports folder, and click ‘Add New Report’. A &lt;i&gt;Report Wizard&lt;/i&gt; will open up. Click next on the first introduction page.&lt;/li&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-zzwsRCLZJrM/TaNw9U73AQI/AAAAAAAABxA/8RveaVbSn9Y/s1600/FetchXmlAddNewRpt.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-zzwsRCLZJrM/TaNw9U73AQI/AAAAAAAABxA/8RveaVbSn9Y/s1600/FetchXmlAddNewRpt.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;Note: To edit exiting custom report created through CRM Report Wizard, select &lt;i&gt;"Add &amp;gt; Existing Item..."&lt;/i&gt; above instead of &lt;i&gt;"Add New Report"&lt;/i&gt;. You can download your custom report from CRM, by selecting your report then &lt;i&gt;Edit &amp;gt; Download Report&lt;/i&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/ul&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-Wf4lhWxQWiA/TackpEn9SVI/AAAAAAAABxo/Fe9nCHnnEC4/s1600/FetchXmlDownloadRdl.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="250" src="http://3.bp.blogspot.com/-Wf4lhWxQWiA/TackpEn9SVI/AAAAAAAABxo/Fe9nCHnnEC4/s400/FetchXmlDownloadRdl.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;Select the Data Source. Choose a name for your data source, on the Type drop down, select &lt;i&gt;Microsoft Dynamics CRM Fetch&lt;/i&gt; as your data provider and provide the connection string of your CRM instance.&lt;br /&gt;&lt;br /&gt;Connection string should be in the following format:&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: xx-small;"&gt;CRM Server URL;[Org Unique Name];[Home Realm URL]&lt;/span&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-OddqkHnEG_4/TaNw9gUi8HI/AAAAAAAABxE/HbDK_k7ce9g/s1600/FetchXmlConnStr.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="317" src="http://4.bp.blogspot.com/-OddqkHnEG_4/TaNw9gUi8HI/AAAAAAAABxE/HbDK_k7ce9g/s400/FetchXmlConnStr.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;If Organization Name is not provided and user belongs to multiple orgs, then the first org returned by CRM is used. To get Org Name, go to &lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: xx-small;"&gt;CRM &amp;gt; Settings &amp;gt; Customizations &amp;gt; Developer Resources.&lt;/span&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-WQJuhizj0fg/TaNw9tlmc9I/AAAAAAAABxI/Kp_3m772MZY/s1600/FetchXmlOrgName1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="203" src="http://2.bp.blogspot.com/-WQJuhizj0fg/TaNw9tlmc9I/AAAAAAAABxI/Kp_3m772MZY/s400/FetchXmlOrgName1.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-LgraBqtisWE/TaNw-M-nZbI/AAAAAAAABxM/ESBZluxcuYI/s1600/FetchXmlOrgName2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="203" src="http://4.bp.blogspot.com/-LgraBqtisWE/TaNw-M-nZbI/AAAAAAAABxM/ESBZluxcuYI/s400/FetchXmlOrgName2.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;Home Realm URL is needed when we use Federation for identity management, and url is the identity provider's url.&lt;br /&gt;&lt;br /&gt;Also provide report credentials. If creating report for CRM online then provide Windows Live ID or if on-premises then provide domain\LoginID&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-nrCgszIVUW8/TaN02NYMsMI/AAAAAAAABxU/Zbo155mNqds/s1600/RptCred.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="317" src="http://2.bp.blogspot.com/-nrCgszIVUW8/TaN02NYMsMI/AAAAAAAABxU/Zbo155mNqds/s400/RptCred.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
Click next.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;Design the Query. Define fetch-xml query that will&amp;nbsp;retrieve&amp;nbsp;the data for your report. Simple and fast way to create fetch-xml is by using CRM itself.&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;Navigate to CRM Advanced Find, and specify a query.&lt;/li&gt;
&lt;li&gt;You can pick the individual columns to be displayed on your report by selecting ‘Edit Columns’.&lt;/li&gt;
&lt;li&gt;After you are satisfied with your query, click ‘Download Fetch XML’.&lt;/li&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-MFY3OMgCchs/TacsH1WfxxI/AAAAAAAABxw/utuV_oIUBh4/s1600/FetchXmlAdvFindDownload.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="245" src="http://1.bp.blogspot.com/-MFY3OMgCchs/TacsH1WfxxI/AAAAAAAABxw/utuV_oIUBh4/s400/FetchXmlAdvFindDownload.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;li&gt;Save the fetch-xml to your local drive.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&amp;nbsp;In the &lt;i&gt;Query string&lt;/i&gt; textbox, copy and paste the content of the fetch-xml you saved above. You can also preview your data on the &lt;i&gt;query designer&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;Click next, select other reporting options on other pages of the wizard and you are done. :)&lt;/li&gt;
&lt;br /&gt;
&lt;li&gt;Now, upload your RDL on the CRM server in the appropriate&amp;nbsp;categories and your report is ready to be displayed in CRM.&lt;/li&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-kGu4PCSL3Yc/TacomeXa4bI/AAAAAAAABxs/RteWv618mos/s1600/FetchXmlUploadRdl.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="280" src="http://3.bp.blogspot.com/-kGu4PCSL3Yc/TacomeXa4bI/AAAAAAAABxs/RteWv618mos/s400/FetchXmlUploadRdl.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/ul&gt;
&lt;div&gt;
So, we have just created a custom fetch-xml report.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: medium; font-weight: bold;"&gt;Overview of Fetch-XML syntax:&lt;/span&gt;&lt;/div&gt;
Let's have a quick look how you can define and use fetch-xml as your report query.&lt;br /&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;fetch&lt;/span&gt; &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="1.0"&lt;/span&gt; &lt;span class="attr"&gt;output-format&lt;/span&gt;&lt;span class="kwrd"&gt;="xml-platform"&lt;/span&gt; &lt;span class="attr"&gt;mapping&lt;/span&gt;&lt;span class="kwrd"&gt;="logical"&lt;/span&gt; &lt;span class="attr"&gt;distinct&lt;/span&gt;&lt;span class="kwrd"&gt;="true"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;entity&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="invoice"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;all-attributes&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;entity&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;fetch&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
In the above xml, &lt;i&gt;&amp;lt;entity&amp;gt;&lt;/i&gt; tag defines CRM entity you want to query and &lt;i&gt;&amp;lt;all-attributes&amp;gt;&lt;/i&gt; tag defines that you want to fetch all columns. In case you want to &lt;b&gt;fetch selected columns&lt;/b&gt; use below...&lt;br /&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;entity&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="invoice"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="name"&amp;nbsp;&lt;/span&gt;&lt;span class="attr"&gt;alias&lt;/span&gt;&lt;span class="kwrd"&gt;="InvoiceName"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="customerid"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="totalamount"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="invoiceid"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;entity&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
"alias" attribute is to define a different column name.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Define sort order&lt;/b&gt;: Use &lt;i&gt;&amp;lt;order&amp;gt;&lt;/i&gt; tag.&lt;br /&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;fetch&lt;/span&gt; &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="1.0"&lt;/span&gt; &lt;span class="attr"&gt;output-format&lt;/span&gt;&lt;span class="kwrd"&gt;="xml-platform"&lt;/span&gt; &lt;span class="attr"&gt;mapping&lt;/span&gt;&lt;span class="kwrd"&gt;="logical"&lt;/span&gt; &lt;span class="attr"&gt;distinct&lt;/span&gt;&lt;span class="kwrd"&gt;="true"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;entity&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="invoice"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="name"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="customerid"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="totalamount"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="invoiceid"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;order&lt;/span&gt; &lt;span class="attr"&gt;attribute&lt;/span&gt;&lt;span class="kwrd"&gt;="name"&lt;/span&gt; &lt;span class="attr"&gt;descending&lt;/span&gt;&lt;span class="kwrd"&gt;="false"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;entity&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;fetch&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Define conditions or filters&lt;/b&gt;: Use &lt;i&gt;&amp;lt;filter&amp;gt;&lt;/i&gt; tag.&lt;br /&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;fetch&lt;/span&gt; &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="1.0"&lt;/span&gt; &lt;span class="attr"&gt;output-format&lt;/span&gt;&lt;span class="kwrd"&gt;="xml-platform"&lt;/span&gt; &lt;span class="attr"&gt;mapping&lt;/span&gt;&lt;span class="kwrd"&gt;="logical"&lt;/span&gt; &lt;span class="attr"&gt;distinct&lt;/span&gt;&lt;span class="kwrd"&gt;="true"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;entity&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="invoice"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="name"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="customerid"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="totalamount"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="invoiceid"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;order&lt;/span&gt; &lt;span class="attr"&gt;attribute&lt;/span&gt;&lt;span class="kwrd"&gt;="name"&lt;/span&gt; &lt;span class="attr"&gt;descending&lt;/span&gt;&lt;span class="kwrd"&gt;="false"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;filter&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="and"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;condition&lt;/span&gt; &lt;span class="attr"&gt;attribute&lt;/span&gt;&lt;span class="kwrd"&gt;="invoicenumber"&lt;/span&gt; &lt;span class="attr"&gt;operator&lt;/span&gt;&lt;span class="kwrd"&gt;="eq"&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;="SomeValue"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;filter&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;entity&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;fetch&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Another example could be,&lt;br /&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;filter&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="and"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;     &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;condition&lt;/span&gt; &lt;span class="attr"&gt;attribute&lt;/span&gt;&lt;span class="kwrd"&gt;="invoicenumber"&lt;/span&gt; &lt;span class="attr"&gt;operator&lt;/span&gt;&lt;span class="kwrd"&gt;="in"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;       &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;SomeValue&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;       &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;AnotherValue&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;     &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;condition&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;filter&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Define entity relationships&lt;/b&gt;: Use &lt;i&gt;&amp;lt;link-entity&amp;gt;&lt;/i&gt; tag.&lt;br /&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;fetch&lt;/span&gt; &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="1.0"&lt;/span&gt; &lt;span class="attr"&gt;output-format&lt;/span&gt;&lt;span class="kwrd"&gt;="xml-platform"&lt;/span&gt; &lt;span class="attr"&gt;mapping&lt;/span&gt;&lt;span class="kwrd"&gt;="logical"&lt;/span&gt; &lt;span class="attr"&gt;distinct&lt;/span&gt;&lt;span class="kwrd"&gt;="true"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;entity&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="invoice"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="name"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="customerid"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="totalamount"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="invoiceid"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;order&lt;/span&gt; &lt;span class="attr"&gt;attribute&lt;/span&gt;&lt;span class="kwrd"&gt;="name"&lt;/span&gt; &lt;span class="attr"&gt;descending&lt;/span&gt;&lt;span class="kwrd"&gt;="false"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;filter&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="and"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;condition&lt;/span&gt; &lt;span class="attr"&gt;attribute&lt;/span&gt;&lt;span class="kwrd"&gt;="invoicenumber"&lt;/span&gt; &lt;span class="attr"&gt;operator&lt;/span&gt;&lt;span class="kwrd"&gt;="eq"&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;="SomeValue"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;filter&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;link-entity&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="psa_project"&lt;/span&gt; &lt;span class="attr"&gt;from&lt;/span&gt;&lt;span class="kwrd"&gt;="psa_projectid"&lt;/span&gt; &lt;span class="attr"&gt;to&lt;/span&gt;&lt;span class="kwrd"&gt;="psa_project"&lt;/span&gt; &lt;span class="attr"&gt;alias&lt;/span&gt;&lt;span class="kwrd"&gt;="Project"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="psa_account"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="psa_accountaddress"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="psa_principalcontact"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;link-entity&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;entity&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;fetch&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Define parameters&lt;/b&gt;: You can also define parameters on the fetch-xml query to take user input.&lt;br /&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;fetch&lt;/span&gt; &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="1.0"&lt;/span&gt; &lt;span class="attr"&gt;output-format&lt;/span&gt;&lt;span class="kwrd"&gt;="xml-platform"&lt;/span&gt; &lt;span class="attr"&gt;mapping&lt;/span&gt;&lt;span class="kwrd"&gt;="logical"&lt;/span&gt; &lt;span class="attr"&gt;distinct&lt;/span&gt;&lt;span class="kwrd"&gt;="true"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;entity&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="invoice"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="name"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="customerid"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="totalamount"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;attribute&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="invoiceid"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;order&lt;/span&gt; &lt;span class="attr"&gt;attribute&lt;/span&gt;&lt;span class="kwrd"&gt;="name"&lt;/span&gt; &lt;span class="attr"&gt;descending&lt;/span&gt;&lt;span class="kwrd"&gt;="false"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;filter&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="and"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;condition&lt;/span&gt; &lt;span class="attr"&gt;attribute&lt;/span&gt;&lt;span class="kwrd"&gt;="invoicenumber"&lt;/span&gt; &lt;span class="attr"&gt;operator&lt;/span&gt;&lt;span class="kwrd"&gt;="eq"&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;="@pInvoiceId"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;filter&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;entity&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;fetch&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Above xml will create a query parameter, &lt;i&gt;pInvoiceId&lt;/i&gt;. Parameter names need to start with @ sign. Also adding the parameter in the fetch query also adds the QueryParameter and ReportParameter nodes in the RDL automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-Tf6_qbURMKc/TadEjYQ5VDI/AAAAAAAABx0/_j3Ljb2t8XI/s1600/FetchXmlRptParam1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="111" src="http://2.bp.blogspot.com/-Tf6_qbURMKc/TadEjYQ5VDI/AAAAAAAABx0/_j3Ljb2t8XI/s400/FetchXmlRptParam1.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Define Pre-Filtering&lt;/b&gt;: This is a way to filter your report data using CRM &lt;i&gt;Advance Find Functionality&lt;/i&gt;. Pre-Filtering actually makes your report context sensitive.&lt;br /&gt;
&lt;br /&gt;
To get it working, you need to add two attributes to the &amp;lt;entity&amp;gt; tag in your fetch-xml.&lt;br /&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;entity&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="invoice"&lt;/span&gt; &lt;span class="attr"&gt;enableprefiltering&lt;/span&gt;&lt;span class="kwrd"&gt;="true"&lt;/span&gt; &lt;span class="attr"&gt;prefilterparametername&lt;/span&gt;&lt;span class="kwrd"&gt;="InvoiceFilter"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
"enableprefiltering", will make the&amp;nbsp;particular&amp;nbsp;entity context sensitive and "prefilterparametername" is optional attribute to provide a name to your pre-filtering parameter. Pre-Filtering adds a Query &amp;amp; &amp;nbsp;Report Parameter to your report, if "prefilterparametername" not provided then the parameter name would be CRM_&lt;i&gt;&amp;lt;EntityName&amp;gt;&lt;/i&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I will try to add more examples later on but for now I think that's enough to get started with Fetch-Xml based reports.&lt;br /&gt;
&lt;!-- Rahul : Post footer start --&gt;
&lt;br/&gt;Join me on &lt;a href='http://fb.rahulsharma.in' target='_blank'&gt;facebook &lt;/a&gt; and feel free to post your comments / feedback / queries.&lt;br/&gt;
&lt;!-- Rahul : Post footer end --&gt;
&lt;br /&gt;
&lt;b&gt;References&lt;/b&gt;:&lt;br /&gt;
&lt;a href="http://technet.microsoft.com/en-us/library/gg554856.aspx" target="_blank"&gt;Microsoft Dynamics CRM Report Authoring Extension Installation Instructions&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-4294539178563844396?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=-k6al6Rbb-M:JhaNJGV3BVk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=-k6al6Rbb-M:JhaNJGV3BVk:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=-k6al6Rbb-M:JhaNJGV3BVk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=-k6al6Rbb-M:JhaNJGV3BVk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=-k6al6Rbb-M:JhaNJGV3BVk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=-k6al6Rbb-M:JhaNJGV3BVk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=-k6al6Rbb-M:JhaNJGV3BVk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/-k6al6Rbb-M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/4294539178563844396/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2011/04/microsoft-dynamics-crm-2011-fetch-xml.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/4294539178563844396?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/4294539178563844396?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/-k6al6Rbb-M/microsoft-dynamics-crm-2011-fetch-xml.html" title="Microsoft Dynamics CRM 2011 Fetch XML based Custom Reports" /><author><name>Rahul Sharma</name><uri>https://profiles.google.com/106670191477938666477</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-L5xBMIwUPQE/AAAAAAAAAAI/AAAAAAAACqU/JAg6BYx9Ssw/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-o_e5D2pC0RE/TaNn54sd3DI/AAAAAAAABw8/kNYt0YD1V1k/s72-c/FetchXmlVSNewProject.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.rahulsharma.in/2011/04/microsoft-dynamics-crm-2011-fetch-xml.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D08AQXs7fCp7ImA9WhZREk0.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-3574361469463965588</id><published>2011-04-06T17:55:00.003-04:00</published><updated>2011-04-07T15:50:40.504-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-07T15:50:40.504-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Axapta" /><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2009" /><title>Convert Dynamics AX Entity Private Address into Public GAB Address</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;In this article, we will see how to convert Customer / Vendor's private addresses into public &lt;a href="http://blog.rahulsharma.in/2010/04/dynamics-ax-global-address-book.html"&gt;GAB&lt;/a&gt; addresses. If you try to do it manually by clicking the public check box on a private address then it will just not allow you to do it.&lt;br /&gt;
&lt;br /&gt;
Here is the code to do so:&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="rem"&gt;//Converts private addresses to public addresses&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; ConvertPrivateAddressToPublic(Args _args)&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    #OCCRetryCount&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    DirPartyAddressRelationshipMapping  dirPartyAddressRelationshipMapping;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    Address                             address, address2;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    DirParty                            dirParty;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    DirPartyTable                       dirPartyTable;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    &lt;span class="kwrd"&gt;void&lt;/span&gt; convertAddress()&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        ;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;        address.clear();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;        address = Address::findRecId(address2.RecId, &lt;span class="kwrd"&gt;true&lt;/span&gt;);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;        &lt;span class="rem"&gt;//dir party associated with the entity&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;        dirParty = DirParty::constructFromCommon(address);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        dirPartyTable = DirPartyTable::find(dirParty.parmPartyId());&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;        &lt;span class="rem"&gt;//update these values so that this private address now belongs to the party of the entity&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;        address.AddrTableId = dirPartyTable.TableId;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;        address.AddrRecId   = dirPartyTable.RecId;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;        address.update();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;        &lt;span class="rem"&gt;//check if GAB mapping has been created&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;        select dirPartyAddressRelationshipMapping&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;            &lt;span class="kwrd"&gt;where&lt;/span&gt; dirPartyAddressRelationshipMapping.AddressRecId == address.RecId &amp;amp;&amp;amp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;                  dirPartyAddressRelationshipMapping.RefCompanyId == address.dataAreaId;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;        &lt;span class="rem"&gt;//create GAB mapping if does not exist&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (!dirPartyAddressRelationshipMapping.RecId)&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;            DirPartyAddress::insertPartyAddressRelationship(address);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;    ;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  37:  &lt;/span&gt;    &lt;span class="rem"&gt;//select private customer and vendor addresses&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  38:  &lt;/span&gt;    &lt;span class="kwrd"&gt;while&lt;/span&gt; select address2&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  39:  &lt;/span&gt;        &lt;span class="kwrd"&gt;where&lt;/span&gt; address2.AddrTableId == tablenum(CustTable) ||&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  40:  &lt;/span&gt;              address2.AddrTableId == tablenum(VendTable)&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  41:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  42:  &lt;/span&gt;        &lt;span class="kwrd"&gt;try&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  43:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  44:  &lt;/span&gt;            ttsbegin;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  45:  &lt;/span&gt;            convertAddress();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  46:  &lt;/span&gt;            ttscommit;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  47:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  48:  &lt;/span&gt;        &lt;span class="kwrd"&gt;catch&lt;/span&gt; (Exception::Deadlock)&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  49:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  50:  &lt;/span&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (xSession::currentRetryCount() &amp;gt;= #RetryNum)&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  51:  &lt;/span&gt;            {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  52:  &lt;/span&gt;                &lt;span class="kwrd"&gt;throw&lt;/span&gt; Exception::Deadlock;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  53:  &lt;/span&gt;            }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  54:  &lt;/span&gt;            &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  55:  &lt;/span&gt;            {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  56:  &lt;/span&gt;                retry;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  57:  &lt;/span&gt;            }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  58:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  59:  &lt;/span&gt;        &lt;span class="kwrd"&gt;catch&lt;/span&gt; (Exception::UpdateConflict)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  60:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  61:  &lt;/span&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (appl.ttsLevel() == 0)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  62:  &lt;/span&gt;            {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  63:  &lt;/span&gt;                &lt;span class="kwrd"&gt;if&lt;/span&gt; (xSession::currentRetryCount() &amp;gt;= #RetryNum)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  64:  &lt;/span&gt;                {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  65:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;throw&lt;/span&gt; Exception::UpdateConflictNotRecovered;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  66:  &lt;/span&gt;                }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  67:  &lt;/span&gt;                &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  68:  &lt;/span&gt;                {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  69:  &lt;/span&gt;                    retry;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  70:  &lt;/span&gt;                }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  71:  &lt;/span&gt;            }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  72:  &lt;/span&gt;            &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  73:  &lt;/span&gt;            {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  74:  &lt;/span&gt;                &lt;span class="kwrd"&gt;throw&lt;/span&gt; Exception::UpdateConflict;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  75:  &lt;/span&gt;            }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  76:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  77:  &lt;/span&gt;        &lt;span class="kwrd"&gt;catch&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  78:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  79:  &lt;/span&gt;            error(strfmt(&lt;span class="str"&gt;"Conversion failed for address record id %1 in %2 company. \n Correct it and resume conversion again."&lt;/span&gt;, address2.RecId, address2.dataAreaId));&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  80:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  81:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  82:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  83:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;
&lt;iframe title ="Preview" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" style="width:98px;height:115px;padding:0;background-color:#fcfcfc;" src="http://cid-0e75794c17db3f50.office.live.com/embedicon.aspx/blog.rahulsharma.in/Job^_ConvertPrivateAddressToPublic.xpo"&gt;&lt;/iframe&gt;
&lt;br /&gt;
Join this blog if you liked this post and feel free to post your comment / feedback / queries.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-3574361469463965588?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=l3I23TaAu18:6km7yBNGlBs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=l3I23TaAu18:6km7yBNGlBs:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=l3I23TaAu18:6km7yBNGlBs:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=l3I23TaAu18:6km7yBNGlBs:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=l3I23TaAu18:6km7yBNGlBs:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=l3I23TaAu18:6km7yBNGlBs:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=l3I23TaAu18:6km7yBNGlBs:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/l3I23TaAu18" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/3574361469463965588/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2011/04/convert-dynamics-ax-entity-private.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/3574361469463965588?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/3574361469463965588?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/l3I23TaAu18/convert-dynamics-ax-entity-private.html" title="Convert Dynamics AX Entity Private Address into Public GAB Address" /><author><name>Rahul Sharma</name><uri>https://profiles.google.com/106670191477938666477</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-L5xBMIwUPQE/AAAAAAAAAAI/AAAAAAAACqU/JAg6BYx9Ssw/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.rahulsharma.in/2011/04/convert-dynamics-ax-entity-private.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkINRng-fip7ImA9WhZUEE4.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-9030864334601075917</id><published>2011-04-03T17:00:00.008-04:00</published><updated>2011-06-02T14:16:37.656-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-02T14:16:37.656-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2012" /><category scheme="http://www.blogger.com/atom/ns#" term="Axapta" /><title>What's new in Microsoft Dynamics AX 2012?</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;In this article, watch out an interview with Guy Weismantel, Microsoft’s Director, ERP Marketing to learn about what's new in Microsoft Dynamics AX 2012 and can Microsoft's largest ERP release take on SAP?&lt;br /&gt;
&lt;br /&gt;
Also check&amp;nbsp;&lt;a href="https://mbs.microsoft.com/partnersource/communities/training/trainingmaterials/student/course80299.htm" target="_blank"&gt;What's New in Microsoft Dynamics AX 2012 for Development&lt;/a&gt; on partnersource.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div dir="ltr" style="text-align: center;" trbidi="on"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="349" src="http://www.youtube.com/embed/Irebzw9fjkQ?rel=0&amp;amp;hd=1" title="YouTube video player" width="560"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Join this blog if you liked this post and feel free to post your comment / feedback / queries.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-9030864334601075917?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=FOjMtYkvGuA:s45pWqxFW38:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=FOjMtYkvGuA:s45pWqxFW38:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=FOjMtYkvGuA:s45pWqxFW38:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=FOjMtYkvGuA:s45pWqxFW38:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=FOjMtYkvGuA:s45pWqxFW38:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=FOjMtYkvGuA:s45pWqxFW38:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=FOjMtYkvGuA:s45pWqxFW38:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/FOjMtYkvGuA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/9030864334601075917/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2011/04/whats-new-in-microsoft-dynamics-ax-2012.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/9030864334601075917?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/9030864334601075917?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/FOjMtYkvGuA/whats-new-in-microsoft-dynamics-ax-2012.html" title="What's new in Microsoft Dynamics AX 2012?" /><author><name>Rahul Sharma</name><uri>https://profiles.google.com/106670191477938666477</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-L5xBMIwUPQE/AAAAAAAAAAI/AAAAAAAACqU/JAg6BYx9Ssw/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://img.youtube.com/vi/Irebzw9fjkQ/default.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.rahulsharma.in/2011/04/whats-new-in-microsoft-dynamics-ax-2012.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0YGQ3k7eSp7ImA9WhZSGUk.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-7637644874882342901</id><published>2010-10-10T09:08:00.028-04:00</published><updated>2011-04-04T15:25:22.701-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-04T15:25:22.701-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Axapta" /><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 4.0" /><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2009" /><title>Dynamics AX Build Numbers</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;a href="http://blogs.msdn.com/b/emeadaxsupport/archive/2009/07/01/overview-ax-kernel-build-numbers.aspx" target="_blank"&gt;List of Dynamics Ax version and kernel/application builds.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;These numbers are changed when you install new service pack / hotfix / roll-up. So, check above link to know which version of Ax SP / hotfix /roll-up you are on.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Other than checking your Ax kernel / application version from the Ax &amp;gt; Help &amp;gt; About Microsoft Dynamics Ax, you can try following as well.&lt;br /&gt;
&lt;div&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;Ax Client Kernel Version:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Ax help form shows this number as a kernel version that is your current client. To know which version of client you are running, check your Ax client executable from the Ax client installation location.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5526418751258545618" src="http://4.bp.blogspot.com/_RGLQxJaFYXk/TLHIkvTSzdI/AAAAAAAABXA/ITzOCh5NGMQ/s320/AxClientBuild.jpg" style="cursor: hand; cursor: pointer; display: block; height: 138px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;br /&gt;
&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"&gt;Ax client executable&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;Ax Server Kernel Version:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;To know which version of AOS you are running, check your Ax server executable from the Ax AOS installation location.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5526421835575919250" src="http://4.bp.blogspot.com/_RGLQxJaFYXk/TLHLYRR3ApI/AAAAAAAABXI/JUNW6J6yNvQ/s320/AxServerBuild.jpg" style="cursor: hand; cursor: pointer; display: block; height: 86px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"&gt;Ax server executable&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;Ax Application Version:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;This is a static text in the Ax class. This is updated when you upgrade / install SP / hotfix etc.&lt;br /&gt;
ApplicationVersion::applBuildNo().&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Join this blog if you liked this post and feel free to post your comment / feedback / queries.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-7637644874882342901?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=XcWRiuEV_6M:iuYSytSo_e0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=XcWRiuEV_6M:iuYSytSo_e0:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=XcWRiuEV_6M:iuYSytSo_e0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=XcWRiuEV_6M:iuYSytSo_e0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=XcWRiuEV_6M:iuYSytSo_e0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=XcWRiuEV_6M:iuYSytSo_e0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=XcWRiuEV_6M:iuYSytSo_e0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/XcWRiuEV_6M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/7637644874882342901/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2010/09/dynamics-ax-build-numbers.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/7637644874882342901?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/7637644874882342901?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/XcWRiuEV_6M/dynamics-ax-build-numbers.html" title="Dynamics AX Build Numbers" /><author><name>Rahul Sharma</name><uri>https://profiles.google.com/106670191477938666477</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-L5xBMIwUPQE/AAAAAAAAAAI/AAAAAAAACqU/JAg6BYx9Ssw/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_RGLQxJaFYXk/TLHIkvTSzdI/AAAAAAAABXA/ITzOCh5NGMQ/s72-c/AxClientBuild.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.rahulsharma.in/2010/09/dynamics-ax-build-numbers.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak4EQn47cCp7ImA9WhZXF0o.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-3978935590480707187</id><published>2010-10-02T12:39:00.011-04:00</published><updated>2011-05-07T10:35:03.008-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-07T10:35:03.008-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Axapta" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint 2010" /><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2009" /><title>MS SharePoint 2010 with Dynamics AX 2009 SP1 Enterprise Portal</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Many people wonder if Microsoft SharePoint 2010 is compatible with Dynamics AX 2009 EP or not. So the good news is, yes these products are fully compatible with each other and you can deploy EP on SharePoint 2010. This can be more interesting when you would like to install Dynamics AX 2009 and Dynamics AX 2012 on a single machine, as Dynamics AX 2012 EP only works with SharePoint 2010.&lt;br /&gt;
&lt;br /&gt;
You would like to upgrade your current SharePoint (MOSS / WSS) to SharePoint 2010, and both In-Place upgrade and Database attach upgrade methods are supported.&lt;br /&gt;
&lt;br /&gt;
Reference:&lt;br /&gt;
&lt;a href="http://blogs.technet.com/b/dynamicsaxse/archive/2010/08/12/new-compatibility-testing-result-august-2010.aspx" target="_blank"&gt;Microsoft SharePoint 2010 with Dynamics AX 2009 Service Pack 1&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;&lt;a href="https://mbs2.microsoft.com/Knowledgebase/KBDisplay.aspx?scid=kb$en-us$2278963&amp;amp;wa=wsignin1.0" target="_blank"&gt;HotFix for Dynamics AX 2009 Service Pack 1&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://technet.microsoft.com/en-us/sharepoint/ee517214.aspx" target="_blank"&gt;Upgrade previous SharePoint version to SharePoint 2010&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://msdn.microsoft.com/en-us/library/ee554869(office.14).aspx" target="_blank"&gt;Install SharePoint 2010 on Windows 7 64-bit&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-3978935590480707187?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=3wlTAQd5Tjs:ZCYrYhz95Mc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=3wlTAQd5Tjs:ZCYrYhz95Mc:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=3wlTAQd5Tjs:ZCYrYhz95Mc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=3wlTAQd5Tjs:ZCYrYhz95Mc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=3wlTAQd5Tjs:ZCYrYhz95Mc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=3wlTAQd5Tjs:ZCYrYhz95Mc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=3wlTAQd5Tjs:ZCYrYhz95Mc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/3wlTAQd5Tjs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/3978935590480707187/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2010/10/ms-sharepoint-2010-with-dynamics-ax.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/3978935590480707187?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/3978935590480707187?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/3wlTAQd5Tjs/ms-sharepoint-2010-with-dynamics-ax.html" title="MS SharePoint 2010 with Dynamics AX 2009 SP1 Enterprise Portal" /><author><name>Rahul Sharma</name><uri>https://profiles.google.com/106670191477938666477</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-L5xBMIwUPQE/AAAAAAAAAAI/AAAAAAAACqU/JAg6BYx9Ssw/s512-c/photo.jpg" /></author><thr:total>3</thr:total><feedburner:origLink>http://blog.rahulsharma.in/2010/10/ms-sharepoint-2010-with-dynamics-ax.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUICRno8fip7ImA9Wx5VEE4.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-3778570718063948628</id><published>2010-10-01T08:52:00.000-04:00</published><updated>2010-10-02T12:39:27.476-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-02T12:39:27.476-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Axapta" /><category scheme="http://www.blogger.com/atom/ns#" term="Ax Enterprise Portal" /><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2009" /><title>MS Dynamics Ax 2009 EP Development - Part 2</title><content type="html">&lt;div&gt;I was planning to write the next part for Enterprise Portal development but then I found this well defined document which specifies steps and things need to be taken care while doing EP development.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Download full MS Dynamics Ax 2009 Enterprise portal development reference from &lt;div&gt;&lt;iframe title ="Preview" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" style="width:98px;height:115px;padding:0;background-color:#fcfcfc;" src="http://cid-0e75794c17db3f50.office.live.com/embedicon.aspx/blog.rahulsharma.in/MS%20Dynamics%20Ax%202009%20EP/AX2009EPDevCookbook.docx"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Please join this blog if you liked this post.&lt;br /&gt;Also feel free to post your comment / feedback / queries.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;References&lt;/b&gt;:&lt;br /&gt;&lt;a href="http://blog.rahulsharma.in/2009/06/ms-dynamics-ax-2009-ep-development-part.html"&gt;MS Dynamics Ax 2009 EP Development - Part 1&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-3778570718063948628?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=gG3LVlyhX1I:M8Rjw2tCadw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=gG3LVlyhX1I:M8Rjw2tCadw:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=gG3LVlyhX1I:M8Rjw2tCadw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=gG3LVlyhX1I:M8Rjw2tCadw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=gG3LVlyhX1I:M8Rjw2tCadw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=gG3LVlyhX1I:M8Rjw2tCadw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=gG3LVlyhX1I:M8Rjw2tCadw:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/gG3LVlyhX1I" height="1" width="1"/&gt;</content><link rel="enclosure" type="text/html" href="http://blog.rahulsharma.in/2009/06/ms-dynamics-ax-2009-ep-development-part.html" length="0" /><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/3778570718063948628/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2009/06/ms-dynamics-ax-2009-ep-development-part_04.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/3778570718063948628?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/3778570718063948628?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/gG3LVlyhX1I/ms-dynamics-ax-2009-ep-development-part_04.html" title="MS Dynamics Ax 2009 EP Development - Part 2" /><author><name>Rahul Sharma</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://1.bp.blogspot.com/_XHhpkCare9U/S7aYwq92s-I/AAAAAAAAAHk/pWlRp8Z2lSo/S220/profile+pic.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://blog.rahulsharma.in/2009/06/ms-dynamics-ax-2009-ep-development-part_04.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkEDRXgyeCp7ImA9WhdQFkU.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-4136312128526559470</id><published>2010-05-30T16:07:00.009-04:00</published><updated>2011-08-18T12:24:34.690-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-18T12:24:34.690-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Web Service" /><category scheme="http://www.blogger.com/atom/ns#" term="Axapta" /><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio .Net" /><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2009" /><category scheme="http://www.blogger.com/atom/ns#" term="ASMX" /><category scheme="http://www.blogger.com/atom/ns#" term="WCF" /><title>Consuming ASMX WebService or WCF Service in Dynamics Ax</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;This post is a quick reference on consuming asmx / svc services in Dynamics Ax. We will also see how to pass .Net types to / from X++ code.&lt;br /&gt;
&lt;br /&gt;
There are two methods available in .Net to create web services, one is old ASMX style and another is WCF service. &lt;br /&gt;
(How to create web service? Do google / bing.)&lt;br /&gt;
&lt;br /&gt;
I have created a ASMX web service and deployed it on my local Windows 7 64-bit IIS 7 laptop, http://rahul:200/TestWebService/HelloWorldWS.asmx. This web service contains two web methods. First method takes an integer argument and returns a string value. Second method takes an array as input and returns an array.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class="csharpcode"&gt;ASMX C# code:&lt;br /&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Web;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Web.Services;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;[WebService(Namespace = &lt;span class="str"&gt;"http://tempuri.org/"&lt;/span&gt;)]&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;&lt;span class="rem"&gt;// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. &lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;&lt;span class="rem"&gt;// [System.Web.Script.Services.ScriptService]&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; HelloWorldWS : System.Web.Services.WebService&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; HelloWorldWS () {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;        &lt;span class="rem"&gt;//Uncomment the following line if using designed components &lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;        &lt;span class="rem"&gt;//InitializeComponent(); &lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;    [WebMethod]&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; GetData(&lt;span class="kwrd"&gt;int&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(&lt;span class="str"&gt;"You entered: {0}"&lt;/span&gt;, &lt;span class="kwrd"&gt;value&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;    [WebMethod]&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;[] GetDataArray(&lt;span class="kwrd"&gt;string&lt;/span&gt;[] &lt;span class="kwrd"&gt;value&lt;/span&gt;)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;        &lt;span class="kwrd"&gt;string&lt;/span&gt;[] ret = &lt;span class="kwrd"&gt;value&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; ret;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;    &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
With same functionality WCF service code will look like this and it is also deployed on my laptop at http://rahul:201/Service.svc.&lt;br /&gt;
&lt;div class="csharpcode"&gt;WCF C# code:&lt;br /&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Runtime.Serialization;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.ServiceModel;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.ServiceModel.Web;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Text;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;&lt;span class="rem"&gt;// NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service" in code, svc and config file together.&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Service : IService&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; GetData(&lt;span class="kwrd"&gt;int&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;)&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(&lt;span class="str"&gt;"You entered: {0}"&lt;/span&gt;, &lt;span class="kwrd"&gt;value&lt;/span&gt;);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;[] GetDataArray(&lt;span class="kwrd"&gt;string&lt;/span&gt;[] &lt;span class="kwrd"&gt;value&lt;/span&gt;)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        &lt;span class="kwrd"&gt;string&lt;/span&gt;[] ret = &lt;span class="kwrd"&gt;value&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; ret;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;Add reference for above web services in Dynamics Ax. &lt;/b&gt;&lt;br /&gt;
You need to go to AOT --&amp;gt; References --&amp;gt; Add service reference. Here you need to add WSDL URL for your web services. You get WSDL URL by adding "?wsdl" at the end of your web service URL.&lt;br /&gt;
ASMX WSDL is: http://rahul:200/TestWebService/HelloWorldWS.asmx?wsdl&lt;br /&gt;
WCF WSDL is: http://rahul:201/Service.svc?wsdl&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_XHhpkCare9U/TAKyP7HoI3I/AAAAAAAACNU/z2CltM4-iq0/s1600/AOTsvcReference1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="262" src="http://3.bp.blogspot.com/_XHhpkCare9U/TAKyP7HoI3I/AAAAAAAACNU/z2CltM4-iq0/s320/AOTsvcReference1.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
AX will generate a proxy .net assembly (namespace provided in above figure) and configuration file (app.config) for the web service. You can find this in your AX installation path at &lt;br /&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Microsoft Ax Dynamics&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;\50\Application\Appl\DynamicsAx50\ServiceReferences&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;Create a wrapper AX class for the proxy.&lt;/b&gt;&lt;br /&gt;
Now we will create a wrapper class for the generated web service proxy. By design, AX needs this class to be running on server tier. So, &lt;i&gt;set class RunOn property to server&lt;/i&gt; and create two methods GetData(int _input) &amp;amp; GetDataArray(Container _inputContainer). You can also create a main() to test web service call at server tier. Then we will create a job that will run on client tier to call our wrapper class.&lt;br /&gt;
&lt;div class="csharpcode"&gt;X++ code:&lt;br /&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="rem"&gt;//X++ (ASMX web service wrapper) class running on server (RunOn: Server)&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; HelloWorldWS&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;}&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;&lt;span class="rem"&gt;//this methods passes int value to web service that return System.String&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; server str GetData(&lt;span class="kwrd"&gt;int&lt;/span&gt; _input = 0)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    Rah.HelloWorldWS.HelloWorldWSSoapClient ws;&lt;span class="rem"&gt;//web service proxy&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    System.String                           wsResult;&lt;span class="rem"&gt;//web method's return value&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;    str                                     retStr;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    ;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;    &lt;span class="kwrd"&gt;try&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;        &lt;span class="kwrd"&gt;new&lt;/span&gt; InteropPermission(InteropKind::ClrInterop).assert();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;        &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;        &lt;span class="rem"&gt;//call web service&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        ws = &lt;span class="kwrd"&gt;new&lt;/span&gt; Rah.HelloWorldWS.HelloWorldWSSoapClient(&lt;span class="str"&gt;"HelloWorldWSSoap"&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;        wsResult = ws.GetData(_input);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;        &lt;span class="rem"&gt;//check if web service call returned value.&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;        &lt;span class="rem"&gt;//web service can return a null object and this null object is not supported in x++&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (!CLRInterop::isNull(wsResult))&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;           info(&lt;span class="str"&gt;"wrapper: "&lt;/span&gt; + any2str(CLRInterop::getAnyTypeForObject(wsResult)));&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;           retStr = any2str(CLRInterop::getAnyTypeForObject(wsResult));&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;        CodeAccessPermission::revertAssert();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; retStr;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;    &lt;span class="kwrd"&gt;catch&lt;/span&gt; (Exception::CLRError)&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;        &lt;span class="kwrd"&gt;throw&lt;/span&gt; error(AifUtil::getClrErrorMessage());&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;}&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  37:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  38:  &lt;/span&gt;&lt;span class="rem"&gt;//this method passes System.String[] as input parameter to web service and&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  39:  &lt;/span&gt;&lt;span class="rem"&gt;//receives System.String[] as output&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  40:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; server container GetDataArray(container _inputContainer = connull())&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  41:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  42:  &lt;/span&gt;    Rah.HelloWorldWS.HelloWorldWSSoapClient ws;&lt;span class="rem"&gt;//web service proxy&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  43:  &lt;/span&gt;    System.String[]                         wsInputArrS;&lt;span class="rem"&gt;//web method's input argument&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  44:  &lt;/span&gt;    System.Array                            wsResultArr;&lt;span class="rem"&gt;//web method's return value&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  45:  &lt;/span&gt;    &lt;span class="kwrd"&gt;int&lt;/span&gt;                                     wsResultArrLen;&lt;span class="rem"&gt;//return value's length&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  46:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  47:  &lt;/span&gt;    &lt;span class="kwrd"&gt;int&lt;/span&gt;                                     i;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  48:  &lt;/span&gt;    container                               retCon;&lt;span class="rem"&gt;//array converted to x++ container, to pass it on client tier&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  49:  &lt;/span&gt;    &lt;span class="kwrd"&gt;int&lt;/span&gt;                                     inputConLen;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  50:  &lt;/span&gt;    ;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  51:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  52:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (_inputContainer != connull())&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  53:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  54:  &lt;/span&gt;        inputConLen = conlen(_inputContainer);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  55:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  56:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  57:  &lt;/span&gt;    &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  58:  &lt;/span&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; retCon;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  59:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  60:  &lt;/span&gt;    &lt;span class="kwrd"&gt;try&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  61:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  62:  &lt;/span&gt;        &lt;span class="kwrd"&gt;new&lt;/span&gt; InteropPermission(InteropKind::ClrInterop).assert();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  63:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  64:  &lt;/span&gt;        &lt;span class="rem"&gt;//initialize .NET Framework array by special X++ syntax, note () at the end&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  65:  &lt;/span&gt;        wsInputArrS = &lt;span class="kwrd"&gt;new&lt;/span&gt; System.String[inputConLen]();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  66:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  67:  &lt;/span&gt;        &lt;span class="rem"&gt;//prepare input&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  68:  &lt;/span&gt;        &lt;span class="kwrd"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; inputConLen; i++)&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  69:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  70:  &lt;/span&gt;            wsInputArrS.SetValue(CLRInterop::getObjectForAnyType(conpeek(_inputContainer, i+1)), i);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  71:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  72:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  73:  &lt;/span&gt;        &lt;span class="rem"&gt;//call web service&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  74:  &lt;/span&gt;        ws = &lt;span class="kwrd"&gt;new&lt;/span&gt; Rah.HelloWorldWS.HelloWorldWSSoapClient(&lt;span class="str"&gt;"HelloWorldWSSoap"&lt;/span&gt;);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  75:  &lt;/span&gt;        wsResultArr = ws.GetDataArray(wsInputArrS);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  76:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  77:  &lt;/span&gt;        &lt;span class="rem"&gt;//check if web service call returned value.&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  78:  &lt;/span&gt;        &lt;span class="rem"&gt;//web service can return a null object and this null object is not supported in x++&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  79:  &lt;/span&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (!CLRInterop::isNull(wsResultArr))&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  80:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  81:  &lt;/span&gt;            wsResultArrLen = wsResultArr.get_Length();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  82:  &lt;/span&gt;            &lt;span class="kwrd"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; wsResultArrLen; i++)&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  83:  &lt;/span&gt;            {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  84:  &lt;/span&gt;                info(&lt;span class="str"&gt;"wrapper: "&lt;/span&gt; + any2str(CLRInterop::getAnyTypeForObject(wsResultArr.GetValue(i))));&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  85:  &lt;/span&gt;                retCon += any2str(CLRInterop::getAnyTypeForObject(wsResultArr.GetValue(i)));&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  86:  &lt;/span&gt;            }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  87:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  88:  &lt;/span&gt;        CodeAccessPermission::revertAssert();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  89:  &lt;/span&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; retCon;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  90:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  91:  &lt;/span&gt;    &lt;span class="kwrd"&gt;catch&lt;/span&gt; (Exception::CLRError)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  92:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  93:  &lt;/span&gt;        &lt;span class="kwrd"&gt;throw&lt;/span&gt; error(AifUtil::getClrErrorMessage());&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  94:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  95:  &lt;/span&gt;}&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  96:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  97:  &lt;/span&gt;&lt;span class="rem"&gt;//test web service call on server tier&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  98:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; main(Args _args)&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  99:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt; 100:  &lt;/span&gt;    str             ret;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 101:  &lt;/span&gt;    container       retCon, con;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt; 102:  &lt;/span&gt;    &lt;span class="kwrd"&gt;int&lt;/span&gt;             i;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 103:  &lt;/span&gt;    ;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt; 104:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 105:  &lt;/span&gt;    ret = HelloWorldWS::GetData(123);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt; 106:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 107:  &lt;/span&gt;    con += &lt;span class="str"&gt;"hello-"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt; 108:  &lt;/span&gt;    con += &lt;span class="str"&gt;"world"&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 109:  &lt;/span&gt;    retCon = HelloWorldWS::GetDataArray(con);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt; 110:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 111:  &lt;/span&gt;    &lt;span class="rem"&gt;//use web service results&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt; 112:  &lt;/span&gt;    info(&lt;span class="str"&gt;"main: "&lt;/span&gt; + ret);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 113:  &lt;/span&gt;    ret = &lt;span class="str"&gt;''&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt; 114:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 115:  &lt;/span&gt;    &lt;span class="kwrd"&gt;for&lt;/span&gt; (i =  0; i &amp;lt; conlen(retCon); i++)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt; 116:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 117:  &lt;/span&gt;        ret += conpeek(retCon, i+1);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt; 118:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 119:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt; 120:  &lt;/span&gt;    info(&lt;span class="str"&gt;"main arr: "&lt;/span&gt; + ret);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 121:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
Also try to call this from AX job.&lt;br /&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; HelloWorldWS_Arr(Args _args)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    str             ret;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    container       retCon, con;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    &lt;span class="kwrd"&gt;int&lt;/span&gt;             i;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    ;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    ret = HelloWorldWS::GetData(123);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    con += &lt;span class="str"&gt;"hello-"&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;    con += &lt;span class="str"&gt;"world"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    retCon = HelloWorldWS::GetDataArray(con);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;    &lt;span class="rem"&gt;//use web service results&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;    info(&lt;span class="str"&gt;"job: "&lt;/span&gt; + ret);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    ret = &lt;span class="str"&gt;''&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;    &lt;span class="kwrd"&gt;for&lt;/span&gt; (i =  0; i &amp;lt; conlen(retCon); i++)&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;        ret += conpeek(retCon, i+1);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;    info(&lt;span class="str"&gt;"job arr: "&lt;/span&gt; + ret);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
Same logic can be applied to create wrapper class for WCF service. &lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: #ea9999;"&gt;&lt;b&gt;Update&lt;/b&gt;:&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: #ea9999;"&gt;You also need to copy the generated app.config and proxy .net assembly from ServiceReferences directory to Server\bin directory. If you don't copy app.config you will get&amp;nbsp;CLRObject could not be created errors when trying to instantiate the first non-service client class. And if the assembly itself is not copied&amp;nbsp;you will get missing reference errors thrown at runtime when instantiating the arrays.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Please join this blog if you liked this post.&lt;br /&gt;
Also feel free to post your comment / feedback / queries.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-4136312128526559470?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=JN1TBW5fRvk:JY5iCcRaGpE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=JN1TBW5fRvk:JY5iCcRaGpE:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=JN1TBW5fRvk:JY5iCcRaGpE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=JN1TBW5fRvk:JY5iCcRaGpE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=JN1TBW5fRvk:JY5iCcRaGpE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=JN1TBW5fRvk:JY5iCcRaGpE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=JN1TBW5fRvk:JY5iCcRaGpE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/JN1TBW5fRvk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/4136312128526559470/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2010/05/consuming-asmx-webservice-or-wcf.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/4136312128526559470?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/4136312128526559470?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/JN1TBW5fRvk/consuming-asmx-webservice-or-wcf.html" title="Consuming ASMX WebService or WCF Service in Dynamics Ax" /><author><name>Rahul Sharma</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://lh6.ggpht.com/_XHhpkCare9U/S8ndABbcqfI/AAAAAAAACJQ/5M0GPtu2TSI/s144/blogger.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_XHhpkCare9U/TAKyP7HoI3I/AAAAAAAACNU/z2CltM4-iq0/s72-c/AOTsvcReference1.JPG" height="72" width="72" /><thr:total>1</thr:total><georss:featurename>New York, NY 10013, USA</georss:featurename><georss:point>40.7203421 -74.0079781</georss:point><georss:box>40.712210600000006 -74.0225691 40.7284736 -73.9933871</georss:box><feedburner:origLink>http://blog.rahulsharma.in/2010/05/consuming-asmx-webservice-or-wcf.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUQAQ3w7eCp7ImA9WxFXGUo.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-1961515023736352017</id><published>2010-05-26T21:36:00.234-04:00</published><updated>2010-05-27T11:15:42.200-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-27T11:15:42.200-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Office Open XML" /><category scheme="http://www.blogger.com/atom/ns#" term="Axapta" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio .Net" /><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2009" /><title>Office Open XML and Dynamics Ax</title><content type="html">Ever wondered what's special about new Microsoft Office file formats, why there is X in all office 2007 or later version file extensions, like docX, xlsX, pptX etc.?&lt;br /&gt;
&lt;br /&gt;
Yes, this is a file format specification from Microsoft and this Office Open XML File Format specification is an open, international, ECMA-376, Second Edition and ISO/IEC 29500 standard. That means, now office document formats are not something that is hidden from the developers or proprietary to Microsoft, its open for all now. If you understand this, then it means you can read, write or modify existing office documents without even installing MS Office on your computer.&lt;br /&gt;
&lt;br /&gt;
The purpose of the Open XML standard is to de-couple documents created by Microsoft Office applications so that they can be manipulated by other applications independent of proprietary formats and without the loss of data.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;How it works?&lt;/b&gt;&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Office Open XML = ZIP compressed package + XML&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
This is a zip-based file format that defines office documents in multiple XML files and packages them all together in a compressed ZIP file. An open xml document is created with multiple document parts with xml markups. As this is a plain xml, you can view the content using any text editor and modify in same way.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Need a proof?&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Create a word document and type &lt;b&gt;&lt;i&gt;H&lt;/i&gt;&lt;/b&gt;ello &lt;b&gt;&lt;i&gt;W&lt;/i&gt;&lt;/b&gt;orld and save. Let's, &lt;b&gt;bold &lt;/b&gt;and &lt;i&gt;italic&lt;/i&gt; first letters of these words as well.&lt;/li&gt;
&lt;li&gt;Now save this document and change it's extension from .docx to .zip.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Extract this zip file and see what it contains. There are few folders and xml files in it.&lt;/li&gt;
&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_XHhpkCare9U/S_3cjulFrNI/AAAAAAAACNQ/wS2BuYU2BlM/s1600/OpenXMLZip1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="70" src="http://2.bp.blogspot.com/_XHhpkCare9U/S_3cjulFrNI/AAAAAAAACNQ/wS2BuYU2BlM/s320/OpenXMLZip1.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
These folders and xml contain everything about an office file. You can use any programming language to read or write these xml files. Just for the info, main document content is in the folder word and file document.xml.&lt;br /&gt;
&lt;br /&gt;
To understand this xml, you can use microsoft xml tool&amp;nbsp;specifically&amp;nbsp;created for reading open xml files.&lt;br /&gt;
Open XML SDK 2.0 Productivity Tool for Microsoft Office&lt;br /&gt;
Below is the sample of our Hello World document.xml file:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:document&lt;/span&gt; &lt;span class="attr"&gt;xmlns:wpc&lt;/span&gt;&lt;span class="kwrd"&gt;="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas"&lt;/span&gt; &lt;span class="attr"&gt;xmlns:mc&lt;/span&gt;&lt;span class="kwrd"&gt;="http://schemas.openxmlformats.org/markup-compatibility/2006"&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;            &lt;span class="attr"&gt;xmlns:o&lt;/span&gt;&lt;span class="kwrd"&gt;="urn:schemas-microsoft-com:office:office"&lt;/span&gt; &lt;span class="attr"&gt;xmlns:r&lt;/span&gt;&lt;span class="kwrd"&gt;="http://schemas.openxmlformats.org/officeDocument/2006/relationships"&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;            &lt;span class="attr"&gt;xmlns:m&lt;/span&gt;&lt;span class="kwrd"&gt;="http://schemas.openxmlformats.org/officeDocument/2006/math"&lt;/span&gt; &lt;span class="attr"&gt;xmlns:v&lt;/span&gt;&lt;span class="kwrd"&gt;="urn:schemas-microsoft-com:vml"&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;            &lt;span class="attr"&gt;xmlns:wp14&lt;/span&gt;&lt;span class="kwrd"&gt;="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"&lt;/span&gt; &lt;span class="attr"&gt;xmlns:wp&lt;/span&gt;&lt;span class="kwrd"&gt;="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;            &lt;span class="attr"&gt;xmlns:w10&lt;/span&gt;&lt;span class="kwrd"&gt;="urn:schemas-microsoft-com:office:word"&lt;/span&gt; &lt;span class="attr"&gt;xmlns:w&lt;/span&gt;&lt;span class="kwrd"&gt;="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;            &lt;span class="attr"&gt;xmlns:w14&lt;/span&gt;&lt;span class="kwrd"&gt;="http://schemas.microsoft.com/office/word/2010/wordml"&lt;/span&gt; &lt;span class="attr"&gt;xmlns:wpg&lt;/span&gt;&lt;span class="kwrd"&gt;="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;            &lt;span class="attr"&gt;xmlns:wpi&lt;/span&gt;&lt;span class="kwrd"&gt;="http://schemas.microsoft.com/office/word/2010/wordprocessingInk"&lt;/span&gt; &lt;span class="attr"&gt;xmlns:wne&lt;/span&gt;&lt;span class="kwrd"&gt;="http://schemas.microsoft.com/office/word/2006/wordml"&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;            &lt;span class="attr"&gt;xmlns:wps&lt;/span&gt;&lt;span class="kwrd"&gt;="http://schemas.microsoft.com/office/word/2010/wordprocessingShape"&lt;/span&gt; &lt;span class="attr"&gt;mc:Ignorable&lt;/span&gt;&lt;span class="kwrd"&gt;="w14 wp14"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:p&lt;/span&gt; &lt;span class="attr"&gt;w:rsidR&lt;/span&gt;&lt;span class="kwrd"&gt;="006D0D97"&lt;/span&gt; &lt;span class="attr"&gt;w:rsidRDefault&lt;/span&gt;&lt;span class="kwrd"&gt;="00334C80"&lt;/span&gt; &lt;span class="attr"&gt;w14:paraId&lt;/span&gt;&lt;span class="kwrd"&gt;="2DC4F30E"&lt;/span&gt; &lt;span class="attr"&gt;w14:textId&lt;/span&gt;&lt;span class="kwrd"&gt;="77777777"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:r&lt;/span&gt; &lt;span class="attr"&gt;w:rsidRPr&lt;/span&gt;&lt;span class="kwrd"&gt;="00334C80"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:rPr&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;          &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:b&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;          &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:i&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;w:rPr&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:t&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;H&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;w:t&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;w:r&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:r&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:t&lt;/span&gt; &lt;span class="attr"&gt;xml:space&lt;/span&gt;&lt;span class="kwrd"&gt;="preserve"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;ello &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;w:t&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;w:r&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:r&lt;/span&gt; &lt;span class="attr"&gt;w:rsidRPr&lt;/span&gt;&lt;span class="kwrd"&gt;="00334C80"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:rPr&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;          &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:b&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;          &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:i&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;w:rPr&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:t&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;W&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;w:t&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;w:r&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:r&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:t&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;orl&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;w:t&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;w:r&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:bookmarkStart&lt;/span&gt; &lt;span class="attr"&gt;w:name&lt;/span&gt;&lt;span class="kwrd"&gt;="_GoBack"&lt;/span&gt; &lt;span class="attr"&gt;w:id&lt;/span&gt;&lt;span class="kwrd"&gt;="0"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:bookmarkEnd&lt;/span&gt; &lt;span class="attr"&gt;w:id&lt;/span&gt;&lt;span class="kwrd"&gt;="0"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:r&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:t&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;d&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;w:t&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;w:r&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;w:p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  37:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:sectPr&lt;/span&gt; &lt;span class="attr"&gt;w:rsidR&lt;/span&gt;&lt;span class="kwrd"&gt;="006D0D97"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  38:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:pgSz&lt;/span&gt; &lt;span class="attr"&gt;w:w&lt;/span&gt;&lt;span class="kwrd"&gt;="12240"&lt;/span&gt; &lt;span class="attr"&gt;w:h&lt;/span&gt;&lt;span class="kwrd"&gt;="15840"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  39:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:pgMar&lt;/span&gt; &lt;span class="attr"&gt;w:top&lt;/span&gt;&lt;span class="kwrd"&gt;="1440"&lt;/span&gt; &lt;span class="attr"&gt;w:right&lt;/span&gt;&lt;span class="kwrd"&gt;="1440"&lt;/span&gt; &lt;span class="attr"&gt;w:bottom&lt;/span&gt;&lt;span class="kwrd"&gt;="1440"&lt;/span&gt; &lt;span class="attr"&gt;w:left&lt;/span&gt;&lt;span class="kwrd"&gt;="1440"&lt;/span&gt; &lt;span class="attr"&gt;w:header&lt;/span&gt;&lt;span class="kwrd"&gt;="720"&lt;/span&gt; &lt;span class="attr"&gt;w:footer&lt;/span&gt;&lt;span class="kwrd"&gt;="720"&lt;/span&gt; &lt;span class="attr"&gt;w:gutter&lt;/span&gt;&lt;span class="kwrd"&gt;="0"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  40:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:cols&lt;/span&gt; &lt;span class="attr"&gt;w:space&lt;/span&gt;&lt;span class="kwrd"&gt;="720"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  41:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:docGrid&lt;/span&gt; &lt;span class="attr"&gt;w:linePitch&lt;/span&gt;&lt;span class="kwrd"&gt;="360"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  42:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;w:sectPr&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  43:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;w:body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  44:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;w:document&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
To understand this xml better, modify your word document or modify this document.xml and see what comes out. But to get you started here is the quick brief explanation of some tags:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Root tag is&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: monospace; white-space: pre;"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: monospace; white-space: pre;"&gt;&lt;span class="html"&gt;w:document&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: monospace; white-space: pre;"&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;. 'w:' is the xml namespace defined in the xmlns attribute of this tag.&lt;/li&gt;
&lt;li&gt;Content always goes into a specific hierarchy of tags. Paragraph --&amp;gt; Run --&amp;gt; text.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:r&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:t&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;your content.&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;w:t&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;w:r&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;w:p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;These attributes has some properties as well and that is self explanatory. Check how this xml defined our Hello World document content. Check what it does to make it bold or italic.&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Note&lt;/i&gt;:&lt;/b&gt; An interesting thing that you should know, if you are inserting a space before or after your content then pay attention to Space=preserver property of Text node.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;w:t&lt;/span&gt; &lt;span class="attr"&gt;xml:space&lt;/span&gt;&lt;span class="kwrd"&gt;="preserve"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;ello &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;w:t&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;If you don't specify that space should be preserved, you wont see this space in your document. Try to play with this xml in notepad and open you word document to see your changes.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;If you don't want to play or feel lazy dealing directly with this xml, then here comes a special SDK for Open XML from Microsoft, called &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C6E744E5-36E9-45F5-8D8C-331DF206E0D0&amp;amp;displaylang=en"&gt;Open XML SDK 2.0 for Microsoft Office&lt;/a&gt;. This provides a set of strongly typed .Net classes and a XML tool for use with open xml.&lt;br /&gt;
&lt;br /&gt;
After installing this SDK, create a .Net project and add reference to &lt;i&gt;DocumentFormat.OpenXml&lt;/i&gt; and &lt;i&gt;WindowsBase&lt;/i&gt; to start playing with this new amazing developer friendly document format.&lt;br /&gt;
&lt;br /&gt;
To create same above document.xml using c# code use below code:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; DocumentFormat.OpenXml.Wordprocessing;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; DocumentFormat.OpenXml;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; GeneratedCode&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; GeneratedClass&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;        &lt;span class="rem"&gt;// Creates an Document instance and adds its children.&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; Document GenerateDocument()&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;            Document document1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; Document() { MCAttributes = &lt;span class="kwrd"&gt;new&lt;/span&gt; MarkupCompatibilityAttributes() { Ignorable = &lt;span class="str"&gt;"w14 wp14"&lt;/span&gt; } };&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;            document1.AddNamespaceDeclaration(&lt;span class="str"&gt;"wpc"&lt;/span&gt;, &lt;span class="str"&gt;"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas"&lt;/span&gt;);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;            document1.AddNamespaceDeclaration(&lt;span class="str"&gt;"mc"&lt;/span&gt;, &lt;span class="str"&gt;"http://schemas.openxmlformats.org/markup-compatibility/2006"&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;            document1.AddNamespaceDeclaration(&lt;span class="str"&gt;"o"&lt;/span&gt;, &lt;span class="str"&gt;"urn:schemas-microsoft-com:office:office"&lt;/span&gt;);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;            document1.AddNamespaceDeclaration(&lt;span class="str"&gt;"r"&lt;/span&gt;, &lt;span class="str"&gt;"http://schemas.openxmlformats.org/officeDocument/2006/relationships"&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;            document1.AddNamespaceDeclaration(&lt;span class="str"&gt;"m"&lt;/span&gt;, &lt;span class="str"&gt;"http://schemas.openxmlformats.org/officeDocument/2006/math"&lt;/span&gt;);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;            document1.AddNamespaceDeclaration(&lt;span class="str"&gt;"v"&lt;/span&gt;, &lt;span class="str"&gt;"urn:schemas-microsoft-com:vml"&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;            document1.AddNamespaceDeclaration(&lt;span class="str"&gt;"wp14"&lt;/span&gt;, &lt;span class="str"&gt;"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"&lt;/span&gt;);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;            document1.AddNamespaceDeclaration(&lt;span class="str"&gt;"wp"&lt;/span&gt;, &lt;span class="str"&gt;"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;            document1.AddNamespaceDeclaration(&lt;span class="str"&gt;"w10"&lt;/span&gt;, &lt;span class="str"&gt;"urn:schemas-microsoft-com:office:word"&lt;/span&gt;);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;            document1.AddNamespaceDeclaration(&lt;span class="str"&gt;"w"&lt;/span&gt;, &lt;span class="str"&gt;"http://schemas.openxmlformats.org/wordprocessingml/2006/main"&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;            document1.AddNamespaceDeclaration(&lt;span class="str"&gt;"w14"&lt;/span&gt;, &lt;span class="str"&gt;"http://schemas.microsoft.com/office/word/2010/wordml"&lt;/span&gt;);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;            document1.AddNamespaceDeclaration(&lt;span class="str"&gt;"wpg"&lt;/span&gt;, &lt;span class="str"&gt;"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;            document1.AddNamespaceDeclaration(&lt;span class="str"&gt;"wpi"&lt;/span&gt;, &lt;span class="str"&gt;"http://schemas.microsoft.com/office/word/2010/wordprocessingInk"&lt;/span&gt;);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;            document1.AddNamespaceDeclaration(&lt;span class="str"&gt;"wne"&lt;/span&gt;, &lt;span class="str"&gt;"http://schemas.microsoft.com/office/word/2006/wordml"&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;            document1.AddNamespaceDeclaration(&lt;span class="str"&gt;"wps"&lt;/span&gt;, &lt;span class="str"&gt;"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"&lt;/span&gt;);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;            Body body1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; Body();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;            Paragraph paragraph1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; Paragraph() { RsidParagraphAddition = &lt;span class="str"&gt;"006D0D97"&lt;/span&gt;, RsidRunAdditionDefault = &lt;span class="str"&gt;"00334C80"&lt;/span&gt;, 
ParagraphId = &lt;span class="str"&gt;"2DC4F30E"&lt;/span&gt;, TextId = &lt;span class="str"&gt;"77777777"&lt;/span&gt; };&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;            Run run1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; Run() { RsidRunProperties = &lt;span class="str"&gt;"00334C80"&lt;/span&gt; };&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;            RunProperties runProperties1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; RunProperties();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;            Bold bold1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; Bold();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;            Italic italic1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; Italic();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  37:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  38:  &lt;/span&gt;            runProperties1.Append(bold1);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  39:  &lt;/span&gt;            runProperties1.Append(italic1);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  40:  &lt;/span&gt;            Text text1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; Text();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  41:  &lt;/span&gt;            text1.Text = &lt;span class="str"&gt;"H"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  42:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  43:  &lt;/span&gt;            run1.Append(runProperties1);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  44:  &lt;/span&gt;            run1.Append(text1);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  45:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  46:  &lt;/span&gt;            Run run2 = &lt;span class="kwrd"&gt;new&lt;/span&gt; Run();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  47:  &lt;/span&gt;            Text text2 = &lt;span class="kwrd"&gt;new&lt;/span&gt; Text() { Space = SpaceProcessingModeValues.Preserve };&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  48:  &lt;/span&gt;            text2.Text = &lt;span class="str"&gt;"ello "&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  49:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  50:  &lt;/span&gt;            run2.Append(text2);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  51:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  52:  &lt;/span&gt;            Run run3 = &lt;span class="kwrd"&gt;new&lt;/span&gt; Run() { RsidRunProperties = &lt;span class="str"&gt;"00334C80"&lt;/span&gt; };&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  53:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  54:  &lt;/span&gt;            RunProperties runProperties2 = &lt;span class="kwrd"&gt;new&lt;/span&gt; RunProperties();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  55:  &lt;/span&gt;            Bold bold2 = &lt;span class="kwrd"&gt;new&lt;/span&gt; Bold();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  56:  &lt;/span&gt;            Italic italic2 = &lt;span class="kwrd"&gt;new&lt;/span&gt; Italic();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  57:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  58:  &lt;/span&gt;            runProperties2.Append(bold2);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  59:  &lt;/span&gt;            runProperties2.Append(italic2);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  60:  &lt;/span&gt;            Text text3 = &lt;span class="kwrd"&gt;new&lt;/span&gt; Text();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  61:  &lt;/span&gt;            text3.Text = &lt;span class="str"&gt;"W"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  62:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  63:  &lt;/span&gt;            run3.Append(runProperties2);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  64:  &lt;/span&gt;            run3.Append(text3);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  65:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  66:  &lt;/span&gt;            Run run4 = &lt;span class="kwrd"&gt;new&lt;/span&gt; Run();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  67:  &lt;/span&gt;            Text text4 = &lt;span class="kwrd"&gt;new&lt;/span&gt; Text();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  68:  &lt;/span&gt;            text4.Text = &lt;span class="str"&gt;"orl"&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  69:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  70:  &lt;/span&gt;            run4.Append(text4);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  71:  &lt;/span&gt;            BookmarkStart bookmarkStart1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; BookmarkStart() { Name = &lt;span class="str"&gt;"_GoBack"&lt;/span&gt;, Id = &lt;span class="str"&gt;"0"&lt;/span&gt; };&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  72:  &lt;/span&gt;            BookmarkEnd bookmarkEnd1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; BookmarkEnd() { Id = &lt;span class="str"&gt;"0"&lt;/span&gt; };&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  73:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  74:  &lt;/span&gt;            Run run5 = &lt;span class="kwrd"&gt;new&lt;/span&gt; Run();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  75:  &lt;/span&gt;            Text text5 = &lt;span class="kwrd"&gt;new&lt;/span&gt; Text();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  76:  &lt;/span&gt;            text5.Text = &lt;span class="str"&gt;"d"&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  77:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  78:  &lt;/span&gt;            run5.Append(text5);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  79:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  80:  &lt;/span&gt;            paragraph1.Append(run1);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  81:  &lt;/span&gt;            paragraph1.Append(run2);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  82:  &lt;/span&gt;            paragraph1.Append(run3);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  83:  &lt;/span&gt;            paragraph1.Append(run4);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  84:  &lt;/span&gt;            paragraph1.Append(bookmarkStart1);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  85:  &lt;/span&gt;            paragraph1.Append(bookmarkEnd1);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  86:  &lt;/span&gt;            paragraph1.Append(run5);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  87:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  88:  &lt;/span&gt;            SectionProperties sectionProperties1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; SectionProperties() { RsidR = &lt;span class="str"&gt;"006D0D97"&lt;/span&gt; };&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  89:  &lt;/span&gt;            PageSize pageSize1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; PageSize() { Width = (UInt32Value)12240U, Height = (UInt32Value)15840U };&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  90:  &lt;/span&gt;            PageMargin pageMargin1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; PageMargin() { Top = 1440, Right = (UInt32Value)1440U, Bottom = 1440, Left = (UInt32Value)1440U, 
Header = (UInt32Value)720U, Footer = (UInt32Value)720U, Gutter = (UInt32Value)0U };&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  91:  &lt;/span&gt;            Columns columns1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; Columns() { Space = &lt;span class="str"&gt;"720"&lt;/span&gt; };&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  92:  &lt;/span&gt;            DocGrid docGrid1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; DocGrid() { LinePitch = 360 };&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  93:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  94:  &lt;/span&gt;            sectionProperties1.Append(pageSize1);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  95:  &lt;/span&gt;            sectionProperties1.Append(pageMargin1);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  96:  &lt;/span&gt;            sectionProperties1.Append(columns1);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  97:  &lt;/span&gt;            sectionProperties1.Append(docGrid1);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  98:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  99:  &lt;/span&gt;            body1.Append(paragraph1);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt; 100:  &lt;/span&gt;            body1.Append(sectionProperties1);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 101:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt; 102:  &lt;/span&gt;            document1.Append(body1);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 103:  &lt;/span&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; document1;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt; 104:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 105:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt; 106:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
Hierarchy is same Document -- Body -- Paragraph -- Run -- Text.&lt;br /&gt;
&lt;br /&gt;
Here is a real world example that uses the Open XML SDK and XML parser classes to modify word document. In this example, we will find all the bookmarks in the word document using XPath and will modify the text nodes falling between the bookmarks. And after our modification, we will save the xml back to the zip package. This will create a smart and fast word mail merge application for our learning. Though the example itself is in C#, but this should give you an idea to use it with any other language as you can always modify XML files using base XML classes of any modern programming language.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;NOTE:&lt;/i&gt;&lt;/b&gt; &lt;b&gt;Dynamics AX developers can utilize the rich XML* system X++ classes to modify open xml directly, OR create a .Net assembly using open xml sdk and add it as a reference in AOT. Though Ax has all of the classes mentioned in this C# example, so this should not be a problem converting this example to X++.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;    &lt;span class="rem"&gt;//xml w namespace&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    &lt;span class="kwrd"&gt;string&lt;/span&gt; wordmlNamespace = &lt;span class="str"&gt;"http://schemas.openxmlformats.org/wordprocessingml/2006/main"&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    &lt;span class="rem"&gt;//Open the document as an Open XML package and extract the main document part.&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    WordprocessingDocument wordPackage = WordprocessingDocument.Open(currentFile, &lt;span class="kwrd"&gt;true&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    MainDocumentPart part = wordPackage.MainDocumentPart;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    &lt;span class="rem"&gt;//Setup the namespace manager so you can perform XPath queries &lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    &lt;span class="rem"&gt;//to search for bookmarks in the part.&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    NameTable nt = &lt;span class="kwrd"&gt;new&lt;/span&gt; NameTable();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;    XmlNamespaceManager nsManager = &lt;span class="kwrd"&gt;new&lt;/span&gt; XmlNamespaceManager(nt);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    nsManager.AddNamespace(&lt;span class="str"&gt;"w"&lt;/span&gt;, wordmlNamespace);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;    &lt;span class="rem"&gt;//Load the part's XML into an XmlDocument instance.&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;    XmlDocument xmlDoc = &lt;span class="kwrd"&gt;new&lt;/span&gt; XmlDocument(nt);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    xmlDoc.Load(part.GetStream());&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;    &lt;span class="rem"&gt;//Find number of bookmarks in the document&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;    &lt;span class="kwrd"&gt;int&lt;/span&gt; numOfBookmarks = xmlDoc.DocumentElement.SelectNodes(&lt;span class="str"&gt;"//w:bookmarkStart"&lt;/span&gt;, nsManager).Count;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;    &lt;span class="rem"&gt;//Iterate through the bookmarks.&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;    &lt;span class="kwrd"&gt;for&lt;/span&gt; (&lt;span class="kwrd"&gt;int&lt;/span&gt; i = 0; i &amp;lt;= numOfBookmarks; i++)&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;        &lt;span class="kwrd"&gt;bool&lt;/span&gt; firstTextNodeFound = &lt;span class="kwrd"&gt;false&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;        &lt;span class="rem"&gt;//"i" is the index number of the bookmarks and the loop counter. &lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;        &lt;span class="rem"&gt;//You use it to retrieve the bookmark by ID.&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;        XmlElement bookmarkStartNode = (XmlElement)xmlDoc.&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;            DocumentElement.SelectSingleNode(&lt;span class="str"&gt;"//w:bookmarkStart[@w:id='"&lt;/span&gt; + i + &lt;span class="str"&gt;"']"&lt;/span&gt;, nsManager);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;        &lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;        &lt;span class="rem"&gt;//Get the beginning and end bookmark nodes as well as the text node for that ID.&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;        XmlNodeList followingNodesList = bookmarkStartNode.&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;            SelectNodes(&lt;span class="str"&gt;".//following::w:t | .//following::w:bookmarkEnd[@w:id='"&lt;/span&gt; + i + &lt;span class="str"&gt;"']"&lt;/span&gt;, nsManager);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;        &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (XmlElement el &lt;span class="kwrd"&gt;in&lt;/span&gt; followingNodesList)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  37:  &lt;/span&gt;            &lt;span class="rem"&gt;//play with the nodes that fall between your bookmark&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  38:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  39:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  40:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  41:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  42:  &lt;/span&gt;    &lt;span class="rem"&gt;//Write the changes back to the document part.&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  43:  &lt;/span&gt;    xmlDoc.Save(wordPackage.MainDocumentPart.GetStream(FileMode.Create));&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  44:  &lt;/span&gt;    wordPackage.Close();&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Please join this blog if you liked this post.&lt;br /&gt;
Also feel free to post your comment / feedback / queries.&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-1961515023736352017?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=Ba8vsK3K0Vo:w8P_ftylPS8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=Ba8vsK3K0Vo:w8P_ftylPS8:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=Ba8vsK3K0Vo:w8P_ftylPS8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=Ba8vsK3K0Vo:w8P_ftylPS8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=Ba8vsK3K0Vo:w8P_ftylPS8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=Ba8vsK3K0Vo:w8P_ftylPS8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=Ba8vsK3K0Vo:w8P_ftylPS8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/Ba8vsK3K0Vo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/1961515023736352017/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2010/05/office-open-xml.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/1961515023736352017?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/1961515023736352017?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/Ba8vsK3K0Vo/office-open-xml.html" title="Office Open XML and Dynamics Ax" /><author><name>Rahul Sharma</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://lh6.ggpht.com/_XHhpkCare9U/S8ndABbcqfI/AAAAAAAACJQ/5M0GPtu2TSI/s144/blogger.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_XHhpkCare9U/S_3cjulFrNI/AAAAAAAACNQ/wS2BuYU2BlM/s72-c/OpenXMLZip1.JPG" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://blog.rahulsharma.in/2010/05/office-open-xml.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcHRno9cCp7ImA9WxFXGU4.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-6943732088981166216</id><published>2010-05-18T20:58:00.006-04:00</published><updated>2010-05-27T00:53:57.468-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-27T00:53:57.468-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Axapta" /><category scheme="http://www.blogger.com/atom/ns#" term="Workflow" /><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2009" /><category scheme="http://www.blogger.com/atom/ns#" term="ASMX" /><title>Dynamics Ax Workflow (IIS 7 64 bit - Http error 405 - Http error 404.17)</title><content type="html">This is the error you receive while trying to access ASMX web service from Windows 7 64-Bit / Windows 2008 Server 64-Bit and IIS 7.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;If you try to validate Dynamics Ax 2009 workflow web service from Ax, you receive below error.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_XHhpkCare9U/S_MuajTkTuI/AAAAAAAACMg/91Fy_wNdWV4/s1600/AxWFvalidateError.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="78" src="http://1.bp.blogspot.com/_XHhpkCare9U/S_MuajTkTuI/AAAAAAAACMg/91Fy_wNdWV4/s320/AxWFvalidateError.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;The request failed with HTTP status 405: Method Not Allowed.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
When you validate workflow from Dynamics Ax, it actually tries to invoke ping method on AxWorkflowInstance.asmx web service. If successful, returns true else false. &lt;br /&gt;
&lt;br /&gt;
And if you try to browse this ASMX web service directly, most probably you will hit the error mentioned below...&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;HTTP Error 404.17 - Not Found&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;The requested content appears to be script and will not be served by the  static file handler.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
Now seeing this error it should be clear that there is some problem with the http handler of your web application.&lt;br /&gt;
&lt;br /&gt;
To resolve this do following two things:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 1&lt;/b&gt;: Set application pool&amp;nbsp;correctly.&lt;br /&gt;
Set "&lt;i&gt;Enable 32-Bit Application&lt;/i&gt;"&amp;nbsp;property&amp;nbsp;to true in the advance settings of your application/virtual directory's application pool.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_XHhpkCare9U/S_MyvVV15LI/AAAAAAAACMk/UalH4xmHBp4/s1600/SetupIIS7_ASMX_64bit+-+1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="162" src="http://4.bp.blogspot.com/_XHhpkCare9U/S_MyvVV15LI/AAAAAAAACMk/UalH4xmHBp4/s320/SetupIIS7_ASMX_64bit+-+1.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Also make sure that application pool is running in Classic mode and on&amp;nbsp;2.0 version of the .NET Framework.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 2&lt;/b&gt;: Check if you have 32 bit mapping for ASMX files.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Open Handler Mappings of your site, application or virtual directory. This is the place where you setup all ISAPI extensions and native modules.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_XHhpkCare9U/S_M0GGfe3SI/AAAAAAAACMo/QgQhHGAeicU/s1600/SetupIIS7_ASMX_64bit+-+2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="162" src="http://1.bp.blogspot.com/_XHhpkCare9U/S_M0GGfe3SI/AAAAAAAACMo/QgQhHGAeicU/s320/SetupIIS7_ASMX_64bit+-+2.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;Check for 32 bit WebServiceHandlerFactory-ISAPI-2.0 ISAP mapping for all ASMX files. Create one if does not exist by clicking on &lt;i&gt;Add Module Mapping...&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_XHhpkCare9U/S_M0KQInEJI/AAAAAAAACMs/L-er4U9AJVk/s1600/SetupIIS7_ASMX_64bit+-+3.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="161" src="http://4.bp.blogspot.com/_XHhpkCare9U/S_M0KQInEJI/AAAAAAAACMs/L-er4U9AJVk/s320/SetupIIS7_ASMX_64bit+-+3.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Click yes on the dialog box.&lt;br /&gt;
&lt;br /&gt;
You can also add it manually to the web.config of your web application. In this case Ax workflow application (C:\Program Files\Microsoft Dynamics AX\50\Workflow). Setting is...&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_XHhpkCare9U/S_M-2GeQFLI/AAAAAAAACMw/MlPKGp0TVuw/s1600/SetupIIS7_ASMX_64bit+-+4.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_XHhpkCare9U/S_M-2GeQFLI/AAAAAAAACMw/MlPKGp0TVuw/s320/SetupIIS7_ASMX_64bit+-+4.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
Please join this blog if you liked this post.&lt;br /&gt;
Also feel free to post your comment / feedback / queries.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-6943732088981166216?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=KA4W9ROlRFM:wNufrmEOvrI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=KA4W9ROlRFM:wNufrmEOvrI:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=KA4W9ROlRFM:wNufrmEOvrI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=KA4W9ROlRFM:wNufrmEOvrI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=KA4W9ROlRFM:wNufrmEOvrI:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=KA4W9ROlRFM:wNufrmEOvrI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=KA4W9ROlRFM:wNufrmEOvrI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/KA4W9ROlRFM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/6943732088981166216/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2010/05/dynamics-ax-workflow-iis-7-64-bit-http.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/6943732088981166216?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/6943732088981166216?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/KA4W9ROlRFM/dynamics-ax-workflow-iis-7-64-bit-http.html" title="Dynamics Ax Workflow (IIS 7 64 bit - Http error 405 - Http error 404.17)" /><author><name>Rahul Sharma</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://lh6.ggpht.com/_XHhpkCare9U/S8ndABbcqfI/AAAAAAAACJQ/5M0GPtu2TSI/s144/blogger.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_XHhpkCare9U/S_MuajTkTuI/AAAAAAAACMg/91Fy_wNdWV4/s72-c/AxWFvalidateError.JPG" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://blog.rahulsharma.in/2010/05/dynamics-ax-workflow-iis-7-64-bit-http.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkQFRH4yfCp7ImA9WxFRF08.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-4092360058715477246</id><published>2010-05-01T09:51:00.004-04:00</published><updated>2010-05-01T11:38:35.094-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-01T11:38:35.094-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Axapta" /><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server" /><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2009" /><title>Dynamics Ax Virtual Company &amp; Table Collections</title><content type="html">This article describes how Dynamics Ax&amp;nbsp;&lt;b&gt;Virtual Company&lt;/b&gt; and&amp;nbsp;&lt;b&gt;Table Collection&lt;/b&gt; work. We will also discuss how to move data from normal company to virtual company when you introduce virtual company in existing Ax implementation. &lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;Virtual Company:&lt;/span&gt;&lt;br /&gt;
Dynamics Ax stores data as per company in tables. But there might be occasions when you want to share data across companies, like country, state, zip codes data. This sharing of data is achieved by creating a &lt;b&gt;virtual company&lt;/b&gt; and storing data in this virtual company. Normal companies are then configured to read/write data from this virtual company. The only purpose of virtual company is to share data across companies, you cannot log into this virtual company.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
Before seeing how to do virtual company setup, I would like you to show another trick that can be used to share data across Ax. There is a property on Ax tables called "&lt;i&gt;&lt;b&gt;SaveDataPerCompany&lt;/b&gt;&lt;/i&gt;", you can use this property to save data&amp;nbsp;globally in Ax. To share data set this property to "&lt;i&gt;No&lt;/i&gt;".&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_XHhpkCare9U/S9b7g6UN9aI/AAAAAAAACK4/1ZRaSbbLV4U/s1600/SharedTable.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="220" src="http://4.bp.blogspot.com/_XHhpkCare9U/S9b7g6UN9aI/AAAAAAAACK4/1ZRaSbbLV4U/s320/SharedTable.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;i&gt;Note: This data is shared by all the companies in Ax. This option will&amp;nbsp;delete DataAreaId field and&amp;nbsp;default (DataAreaId, RecId) index from the table. If you want more control on shared data, like which companies can share and which can not then use virtual company.&amp;nbsp;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Virtual Company setup:&lt;/b&gt;&lt;br /&gt;
&lt;h2&gt;&lt;span style="font-size: medium;"&gt;Step 1: Create Table Collection&lt;/span&gt;&lt;/h2&gt;Decide which tables you want to share and create a table collection for these&amp;nbsp;functionally&amp;nbsp;related tables. For example; if you want to share &lt;a href="http://blog.rahulsharma.in/2010/04/dynamics-ax-global-address-book.html"&gt;Global Address Book&lt;/a&gt; across companies then you can utilize the existing table collection "DirPartyCollection".&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_XHhpkCare9U/S9b86d9WUVI/AAAAAAAACK8/fR0GFHvM6HQ/s1600/DirPartyCollection.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/_XHhpkCare9U/S9b86d9WUVI/AAAAAAAACK8/fR0GFHvM6HQ/s320/DirPartyCollection.JPG" width="174" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
To create a table collection, go to &lt;i&gt;AOT\Data Dictionary\Table Collections&lt;/i&gt; and on right click select "&lt;i&gt;New Table Collection&lt;/i&gt;", then just drag your required tables in this collection.&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: large; font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="font-size: medium; font-weight: normal;"&gt;&lt;br /&gt;
&lt;/span&gt;Step 2: Create Virtual Company, configure/attach normal companies and table collection&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Create a virtual company that will hold the shared data for normal companies.&lt;br /&gt;
&lt;i&gt;Note: Before doing the below steps, make sure you are the Ax administrator and the only user online.&lt;/i&gt;&lt;/div&gt;&lt;ol&gt;&lt;li&gt;Go to &lt;i&gt;Administration -- Setup -- Virtual company accounts&lt;/i&gt;, and create a virtual company.&lt;br /&gt;
&lt;/li&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_XHhpkCare9U/S9cAT6gYmvI/AAAAAAAACLA/uhsZmcWmmok/s1600/VirtualCompany1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="118" src="http://1.bp.blogspot.com/_XHhpkCare9U/S9cAT6gYmvI/AAAAAAAACLA/uhsZmcWmmok/s320/VirtualCompany1.JPG" width="320" /&gt;&lt;/a&gt; &lt;/div&gt;&lt;li&gt;Decide which companies needs to share data and attach those normal companies with this virtual company.&lt;br /&gt;
&lt;/li&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_XHhpkCare9U/S9cAZcDw8sI/AAAAAAAACLE/VMm9y5qbFlg/s1600/VirtualComapny2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="169" src="http://2.bp.blogspot.com/_XHhpkCare9U/S9cAZcDw8sI/AAAAAAAACLE/VMm9y5qbFlg/s320/VirtualComapny2.JPG" width="320" /&gt;&lt;/a&gt; &lt;/div&gt;&lt;li&gt;Attach the table collection with this virtual company.&lt;br /&gt;
&lt;/li&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_XHhpkCare9U/S9cAdZBcLyI/AAAAAAAACLI/lN98keRdX2g/s1600/VirtualCompany3.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="163" src="http://3.bp.blogspot.com/_XHhpkCare9U/S9cAdZBcLyI/AAAAAAAACLI/lN98keRdX2g/s320/VirtualCompany3.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/ol&gt;&lt;br /&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Your Ax client will re-start and you are done with setting up the virtual company account.&lt;/div&gt;&lt;br /&gt;
Now, when you have virtual company in place, all new data will be saved in this virtual company. Only companies attached to the virtual company can use this shared data. All other companies which are not attached will work normally, these companies will continue to read/write data as per company bases.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;How to move existing data to virtual company?&lt;/span&gt;&lt;br /&gt;
When you setup a new virtual company, Ax does not move data automatically from normal company to virtual company. This is done by system administrator manually.&lt;br /&gt;
&lt;br /&gt;
There are many ways to do this data move, but I will discuss only two approaches here.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Ax Import / Export:&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;This is standard Ax approach.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Manually export existing normal company data from Ax.&lt;/li&gt;
&lt;li&gt;Remove duplicate records from this exported data set.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Delete exported data from normal companies.&lt;/li&gt;
&lt;li&gt;Import the exported data back in Ax, while logged into one of the participating companies.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Create records deleted in point 2 again in Ax using your logic. How you want to handle duplicate? For example, if you have customer 'Rah' in more than one normal company, what you want to do with this?&lt;/li&gt;
&lt;/ol&gt;&lt;b&gt;Direct SQL:&lt;/b&gt;&lt;br /&gt;
Use this approach if you have good knowledge about SQL queries and Ax table structures/relationships. Below are few points that will help you understand what to do and how to do.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;All Ax tables store data &lt;i&gt;as per company&lt;/i&gt; unless otherwise specified. For this, Ax uses a special field called DataAreaId. In case of virtual company, it does not matter from which normal company you log-in, it is always the virtual company id which is stored in DataAreaId field of shared tables.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Ax also assigns a &lt;i&gt;unique 64bit number to each record&lt;/i&gt; in table. For this, Ax uses a special field called RecId. This RecId is unique in the table and&amp;nbsp;is generated by Ax when you insert a new record in Ax. It is not related to DataAreaId / Company.&lt;/li&gt;
&lt;li&gt;For unique records between all participating normal companies, update the DataAreaId to the virtual company id.&lt;/li&gt;
&lt;li&gt;For duplicate records, create them again in Ax using some Ax job or Ax import/export&amp;nbsp;technique.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
Attached below are some SQL queries that might help you moving the &lt;a href="http://blog.rahulsharma.in/2010/04/dynamics-ax-global-address-book.html"&gt;Global Address Book&lt;/a&gt; records from normal companies to the virtual company by changing the DataAreaId.&lt;br /&gt;
&lt;br /&gt;
&lt;iframe frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://cid-0e75794c17db3f50.skydrive.live.com/embedicon.aspx/blog.rahulsharma.in/SQLQuery-GlobalAddBook-Move-Blog.sql" style="background-color: #fcfcfc; height: 115px; padding: 0; width: 98px;" title="Preview"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Feel free to post feedback / comments / queries.&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-4092360058715477246?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=ePkZeL64APU:HMvr8mRWLCE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=ePkZeL64APU:HMvr8mRWLCE:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=ePkZeL64APU:HMvr8mRWLCE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=ePkZeL64APU:HMvr8mRWLCE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=ePkZeL64APU:HMvr8mRWLCE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=ePkZeL64APU:HMvr8mRWLCE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=ePkZeL64APU:HMvr8mRWLCE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/ePkZeL64APU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/4092360058715477246/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2010/05/dynamics-ax-virtual-company-table.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/4092360058715477246?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/4092360058715477246?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/ePkZeL64APU/dynamics-ax-virtual-company-table.html" title="Dynamics Ax Virtual Company &amp; Table Collections" /><author><name>Rahul Sharma</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://lh5.ggpht.com/_XHhpkCare9U/S7_Y_luXouI/AAAAAAAACDw/xw6MixiFCtY/s800/Rahul-profile-2small.JPG" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_XHhpkCare9U/S9b7g6UN9aI/AAAAAAAACK4/1ZRaSbbLV4U/s72-c/SharedTable.JPG" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://blog.rahulsharma.in/2010/05/dynamics-ax-virtual-company-table.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkANSXg4fSp7ImA9WxFWFEQ.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-4200542711444976650</id><published>2010-04-20T19:53:00.009-04:00</published><updated>2010-06-02T12:06:38.635-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-02T12:06:38.635-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Axapta" /><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server" /><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2009" /><title>Dynamics Ax Global Address Book</title><content type="html">In this article we will discuss a very important and useful Dynamics Ax feature, &lt;b&gt;Global Address Book.&lt;/b&gt;&amp;nbsp;This article is good for both functional and technical consultants.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Note: This article is for advanced Dynamics Ax users. Good knowledge of Dynamics Ax and SQL server is required.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;b&gt;Global Address Book&lt;/b&gt;: It 's a mechanism to share organization details, mainly communication and address, between different business entities in the company. For example, you may have a customer which is also a vendor; in this case there would be data&amp;nbsp;redundancy&amp;nbsp;or&amp;nbsp;unnecessary duplication of address data if you had to enter the same address on customer and vendor. Wouldn't it be good, if you can store data once in Address table and share this between different business identities of the company. Yeah, sounds good. Solution to this problem is global address book or sometimes you call it directory.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
This concept works on business parties. You create a business party in the global address book, defines various information regarding this, like addresses, communication details etc. You can create two types of parties, Organization (customer, vendor, business relation etc.) or Person (contact etc.).&lt;br /&gt;
&lt;br /&gt;
All these&amp;nbsp;parties are uniquely identified by PartyId in Ax. Ax uses this PartyId to connect address book to master records. Open customer form and go to general tab, you will see it.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_XHhpkCare9U/S7oKx9f4K-I/AAAAAAAACAQ/8A4tuZ5natk/s1600-h/CustGenTab.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="282" src="http://4.bp.blogspot.com/_XHhpkCare9U/S7oKx9f4K-I/AAAAAAAACAQ/8A4tuZ5natk/s320/CustGenTab.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
You can create global address book entry in two ways. First create address book record and then attach it to customer / vendor at the time of customer / vendor creation. Customer (same&amp;nbsp;applies to other business entities as well) form actually do it automatically. If you specify the same Customer Name as of your address book, it will attach it&amp;nbsp;correctly. Second, if you are creating customer first, then also, if Ax does not find name in address book, it will create one address book entry for the same.&lt;br /&gt;
&lt;br /&gt;
Ok, It's good that you can share addresses but what about the cases where you don't want to share a particular address entry on address book between business entities. Yeah, there may be chances where you want to keep address private to your business entity. Do you see Public checkbox on customer form address tab?&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_XHhpkCare9U/S7oLgtPRw4I/AAAAAAAACAU/EOVd2-sQjS8/s1600-h/CustAddTab.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="51" src="http://2.bp.blogspot.com/_XHhpkCare9U/S7oLgtPRw4I/AAAAAAAACAU/EOVd2-sQjS8/s320/CustAddTab.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;i&gt;Public / Private Address&lt;/i&gt;: Only public addresses are stored in global address book. Private addresses are stored with respect to the business entity. I will explain how all this stuff is handled in a short while.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_XHhpkCare9U/S7oMuM_It2I/AAAAAAAACAY/KVDfNhng0EY/s1600-h/AddBookAddTab.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="158" src="http://3.bp.blogspot.com/_XHhpkCare9U/S7oMuM_It2I/AAAAAAAACAY/KVDfNhng0EY/s320/AddBookAddTab.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
In the above picture, you can see same addresses that you have created on your customer but not it's private address. And if you see grid at the bottom, it says that I am sharing the same address for customer 'RahulCust' and vendor 'RahVend'. Cool, hmmm!&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Primary address&lt;/i&gt;: This is your primary address for the address book. You can create only one primary address per address book entry.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Techies Talk:&lt;/b&gt;&lt;br /&gt;
Below are the tables involved in Global Address Book (&lt;b&gt;Public addresses&lt;/b&gt;) creation:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;DirECommunicationAddress&lt;/li&gt;
&lt;li&gt;DirECommunicationTypeTable&lt;/li&gt;
&lt;li&gt;DirECommunicationTypeTxt&lt;/li&gt;
&lt;li&gt;DirOrganizationDetail&lt;/li&gt;
&lt;li&gt;DirParameters&lt;/li&gt;
&lt;li&gt;DirPartyAddressRelationship&lt;/li&gt;
&lt;li&gt;DirPartyAddressRelationshipMapping&lt;/li&gt;
&lt;li&gt;DirPartyECommunicationRelationship&lt;/li&gt;
&lt;li&gt;DirPartyRelationship&lt;/li&gt;
&lt;li&gt;DirPartyTable&lt;/li&gt;
&lt;li&gt;DirPersonGenerationalSuffixTable&lt;/li&gt;
&lt;li&gt;DirPersonPartyDetail&lt;/li&gt;
&lt;li&gt;DirPersonSalutationTable&lt;/li&gt;
&lt;li&gt;DirPrivacyGroupTable&lt;/li&gt;
&lt;li&gt;DirRelationshipTypeTable&lt;/li&gt;
&lt;li&gt;Address&lt;/li&gt;
&lt;li&gt;Entity table. (CustTable, VendTable etc.)&lt;/li&gt;
&lt;/ol&gt;Most of the tables store some related information about the party. So, we will only discuss about the important ones used in creating links between address and business entities.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;DirPartyTable&lt;/i&gt;,&amp;nbsp;&lt;i&gt;DirPartyECommunicationRelationship&lt;/i&gt;,&amp;nbsp;&lt;i&gt;DirPartyAddressRelationshipMapping&lt;/i&gt;, &lt;i&gt;Address &lt;/i&gt;and for business entity we will use &lt;i&gt;CustTable&lt;/i&gt;.&lt;br /&gt;
&lt;br /&gt;
So, to define the relationship between Address and Customer, see SQL query below. It's a very simple SQL query which describes relationship between all these tables. Here you go...&lt;br /&gt;
&lt;div class="csharpcode"&gt;SQL:&lt;br /&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;Select&lt;/span&gt; CUSTTABLE.ACCOUNTNUM, CUSTTABLE.PARTYID, DIRPARTYADDRESSRELATIONSHIP.SHARED, DIRPARTYADDRESSRELATIONSHIP.ISPRIMARY,&lt;/pre&gt;&lt;pre&gt;DIRPARTYTABLE.RECID &lt;span class="kwrd"&gt;as&lt;/span&gt; DirPRecId, DIRPARTYTABLE.DATAAREAID &lt;span class="kwrd"&gt;as&lt;/span&gt; DirPDatId,&lt;/pre&gt;&lt;pre class="alt"&gt;DIRPARTYADDRESSRELATIONSHIP.RECID &lt;span class="kwrd"&gt;as&lt;/span&gt; DirPAdRelRecId, DIRPARTYADDRESSRELATIONSHIP.DATAAREAID &lt;span class="kwrd"&gt;as&lt;/span&gt; DirPAdRelDatId,&lt;/pre&gt;&lt;pre&gt;DIRPARTYADDRESSRELATIONSHI1066.RECID &lt;span class="kwrd"&gt;as&lt;/span&gt; DirPAdRelMapRecId, DIRPARTYADDRESSRELATIONSHI1066.DATAAREAID &lt;span class="kwrd"&gt;as&lt;/span&gt; DirPAdRelMapDatId,&lt;/pre&gt;&lt;pre class="alt"&gt;ADDRESS.RECID &lt;span class="kwrd"&gt;as&lt;/span&gt; AddRecId, ADDRESS.DATAAREAID &lt;span class="kwrd"&gt;as&lt;/span&gt; AddDatId, ADDRESS.*&lt;/pre&gt;&lt;pre&gt;&lt;span class="kwrd"&gt;From&lt;/span&gt; CUSTTABLE&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;Inner&lt;/span&gt; &lt;span class="kwrd"&gt;Join&lt;/span&gt; DIRPARTYTABLE &lt;span class="kwrd"&gt;on&lt;/span&gt; CUSTTABLE.PARTYID = DIRPARTYTABLE.PARTYID&lt;/pre&gt;&lt;pre&gt;&lt;span class="kwrd"&gt;and&lt;/span&gt; CUSTTABLE.DATAAREAID = DIRPARTYTABLE.DATAAREAID&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;Inner&lt;/span&gt; &lt;span class="kwrd"&gt;Join&lt;/span&gt; DIRPARTYADDRESSRELATIONSHIP &lt;span class="kwrd"&gt;on&lt;/span&gt; DIRPARTYTABLE.PARTYID = DIRPARTYADDRESSRELATIONSHIP.PARTYID&lt;/pre&gt;&lt;pre&gt;&lt;span class="kwrd"&gt;and&lt;/span&gt; DIRPARTYTABLE.DATAAREAID = DIRPARTYADDRESSRELATIONSHIP.DATAAREAID&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;Inner&lt;/span&gt; &lt;span class="kwrd"&gt;Join&lt;/span&gt; DIRPARTYADDRESSRELATIONSHI1066 &lt;span class="kwrd"&gt;on&lt;/span&gt; DIRPARTYADDRESSRELATIONSHIP.RECID = DIRPARTYADDRESSRELATIONSHI1066.PARTYADDRESSRELATIONSHIPRECID&lt;/pre&gt;&lt;pre&gt;&lt;span class="kwrd"&gt;and&lt;/span&gt; DIRPARTYADDRESSRELATIONSHIP.DATAAREAID = DIRPARTYADDRESSRELATIONSHI1066.DATAAREAID&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;Inner&lt;/span&gt; &lt;span class="kwrd"&gt;Join&lt;/span&gt; [ADDRESS] &lt;span class="kwrd"&gt;on&lt;/span&gt;    DIRPARTYADDRESSRELATIONSHI1066.REFCOMPANYID = ADDRESS.DATAAREAID&lt;/pre&gt;&lt;pre&gt;&lt;span class="kwrd"&gt;and&lt;/span&gt; DIRPARTYADDRESSRELATIONSHI1066.ADDRESSRECID = ADDRESS.RECID&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;and&lt;/span&gt; DIRPARTYADDRESSRELATIONSHI1066.DATAAREAID = ADDRESS.DATAAREAID&lt;/pre&gt;&lt;pre&gt;&lt;span class="kwrd"&gt;Where&lt;/span&gt; CUSTTABLE.ACCOUNTNUM = &lt;span class="str"&gt;'RahulCust'&lt;/span&gt; &lt;span class="kwrd"&gt;and&lt;/span&gt; CUSTTABLE.DATAAREAID = &lt;span class="str"&gt;'ceu'&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;--SQL Table name of Ax table&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;DirPartyAddressRelationshipMapping&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;is DIRPARTYADDRESSRELATIONSHI1066&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Note: The above query will only work if you are not sharing DIR*, Address or CustTable. If you have any of these tables shared, then just change the &lt;u&gt;Join&lt;/u&gt; and&amp;nbsp;&lt;u&gt;Where&lt;/u&gt; clause for DATAAREAID such that it points to right normal / virtual companies.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Below are the tables involved in the &lt;b&gt;private addresses&lt;/b&gt;:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Address&lt;/li&gt;
&lt;li&gt;Entity table. (CustTable, VendTable etc.)&lt;/li&gt;
&lt;/ol&gt;This is the query to reach at private address of an entity (CustTable).&lt;br /&gt;
&lt;br /&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;Select&lt;/span&gt; * &lt;span class="kwrd"&gt;From&lt;/span&gt; ADDRESS &lt;/pre&gt;&lt;pre&gt;&lt;span class="kwrd"&gt;Where&lt;/span&gt; ADDRTABLEID = 77 &lt;span class="kwrd"&gt;and&lt;/span&gt; ADDRRECID = 5637144580&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;i&gt;Note:&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;AddrTableId = Entity table id.&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;AddrRecId = Entity record id&lt;/i&gt;.&lt;br /&gt;
&lt;br /&gt;
Now, after seeing these queries you should be able to define the relationship between address and any business entity in Ax.&lt;br /&gt;
&lt;br /&gt;
Just for the quick note, there are three parts involved in Global Address Book.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;i&gt;Entity Tables&lt;/i&gt; like, CustTable, VendTable etc.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Global Address Book tables&lt;/i&gt;, all tables starting with Dir*. Already mentioned above.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Address tables&lt;/i&gt;, tables used to store actual address like Address, AddressCountryRegion, AddressState, AddressZipCode etc.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
In next article we will discuss how to handle things when &lt;a href="http://blog.rahulsharma.in/2010/05/dynamics-ax-virtual-company-table.html"&gt;shared tables or virtual companies&lt;/a&gt; are in place. We will also see how to move data from normal to virtual company after you share tables in Ax.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Feel free to post feedback / comments / queries.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-4200542711444976650?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=7rY357Rcp5Q:rU9Mq3g82NA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=7rY357Rcp5Q:rU9Mq3g82NA:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=7rY357Rcp5Q:rU9Mq3g82NA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=7rY357Rcp5Q:rU9Mq3g82NA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=7rY357Rcp5Q:rU9Mq3g82NA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=7rY357Rcp5Q:rU9Mq3g82NA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=7rY357Rcp5Q:rU9Mq3g82NA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/7rY357Rcp5Q" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/4200542711444976650/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2010/04/dynamics-ax-global-address-book.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/4200542711444976650?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/4200542711444976650?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/7rY357Rcp5Q/dynamics-ax-global-address-book.html" title="Dynamics Ax Global Address Book" /><author><name>Rahul Sharma</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://1.bp.blogspot.com/_XHhpkCare9U/S7aYwq92s-I/AAAAAAAAAHk/pWlRp8Z2lSo/S220/profile+pic.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_XHhpkCare9U/S7oKx9f4K-I/AAAAAAAACAQ/8A4tuZ5natk/s72-c/CustGenTab.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.rahulsharma.in/2010/04/dynamics-ax-global-address-book.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEEFR3s9eCp7ImA9WxFTFE4.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-3630374567974032031</id><published>2010-04-04T20:56:00.007-04:00</published><updated>2010-04-04T21:56:56.560-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-04T21:56:56.560-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Axapta" /><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2009" /><title>Dynamics Ax 'SqlStatementExecutePermission' failed</title><content type="html">If you are running native SQL statements in Ax, you might see below error while executing code.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;Request for the permission of type 'SqlStatementExecutePermission' failed.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;(S)\Classes\SqlStatementExecutePermission\demand&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;(S)\Classes\Statement\executeQuery&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;(C)\Jobs\RahAddressImport - line 76&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
Code snippet you might be using:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;sqlQ = "Select * From CustTable";&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Set code access permission to help protect the use of&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Statement.executeUpdate.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;perm = new SqlStatementExecutePermission(sqlQ);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;perm.assert();//should run on server&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;try&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// BP deviation documented&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: red;"&gt;rs = cmd.executeQuery(sqlQ);//will throw error&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while (rs.next())&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//process records&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This only means that your code is running on client side.&amp;nbsp;You must call the assert method in your code on the same tier, usually the server tier, that the corresponding CodeAccessPermission::demand method is called on before the protected API is executed. Call a method on the server tier from one of the following:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;A server static method&lt;/li&gt;
&lt;/ul&gt;-or-&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;A class instance method that is set to run on the server by using the RunOn class property&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
Feel free to post any comment / feedback here.&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-3630374567974032031?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=iVPANIzUl3k:MZa-s-gUjEc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=iVPANIzUl3k:MZa-s-gUjEc:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=iVPANIzUl3k:MZa-s-gUjEc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=iVPANIzUl3k:MZa-s-gUjEc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=iVPANIzUl3k:MZa-s-gUjEc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=iVPANIzUl3k:MZa-s-gUjEc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=iVPANIzUl3k:MZa-s-gUjEc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/iVPANIzUl3k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/3630374567974032031/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2010/04/dynamics-ax-sqlstatementexecutepermissi.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/3630374567974032031?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/3630374567974032031?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/iVPANIzUl3k/dynamics-ax-sqlstatementexecutepermissi.html" title="Dynamics Ax 'SqlStatementExecutePermission' failed" /><author><name>Rahul Sharma</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://1.bp.blogspot.com/_XHhpkCare9U/S7aYwq92s-I/AAAAAAAAAHk/pWlRp8Z2lSo/S220/profile+pic.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.rahulsharma.in/2010/04/dynamics-ax-sqlstatementexecutepermissi.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU4MSXc-eyp7ImA9WxFTFE8.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-9126440952980474587</id><published>2010-03-29T21:11:00.004-04:00</published><updated>2010-04-04T20:39:48.953-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-04T20:39:48.953-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Axapta" /><title>Dynamics Ax Query Extended Range Value Expression</title><content type="html">In this article we will see how to define extended query ranges using expressions. These expressions can be used in any query where you need to express a range that is more complex than is possible with the usual range value notations.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/" name="more"&gt;&lt;/a&gt;&lt;br /&gt;
The rules for creating query range value expressions are:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Enclose the whole expression in parentheses.&lt;/li&gt;
&lt;li&gt;Enclose all subexpressions in parentheses.&lt;/li&gt;
&lt;li&gt;Use the relational and logical operators available in X++.&lt;/li&gt;
&lt;li&gt;Only use field names from the range's data source.&lt;/li&gt;
&lt;li&gt;Use the dataSource.field notation for fields from other data sources in the query.&lt;/li&gt;
&lt;li&gt;Values must be constants in the expression, so any function or outside variable must be calculated before the expression is evaluated by the query. This is typically done by using the &lt;i&gt;strFmt &lt;/i&gt;function.&lt;/li&gt;
&lt;/ul&gt;Let's do it with some examples:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;OR clause on same field:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Query q;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;QueryBuildDataSource qbd;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;QueryBuildRange qbr;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;q = new Query();&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;qbd = q.addDataSource(TableNum(CustTable));&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;qbr = qbd.addRange(FieldNum(CustTable, AccountNum));&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;qbr.value('4005, 4006');&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Result:&amp;nbsp;SELECT * FROM CustTable WHERE ((AccountNum = N'4005' OR AccountNum = N'4006'))&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;or use this expression to achieve the same...&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;qbr.value(strFmt('((AccountNum == "%1") || (AccountNum == "%2"))',&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;QueryValue('4005'),&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;QueryValue('4006')));&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Result:&amp;nbsp;SELECT * FROM CustTable WHERE ((((AccountNum == "4005") || (AccountNum == "4006"))))&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;OR&amp;nbsp;&lt;/b&gt;&lt;b&gt;clause&amp;nbsp;&lt;/b&gt;&lt;b&gt;on different fields:&lt;/b&gt;&amp;nbsp;In this example we are using DataAreaId field to obtain range object but actual range is on AccountNum and Name. This means when you use range value expressions you can use any field to obtain range object and use it to insert your range in the query. The field you use to get range object is not included in the query. &amp;nbsp;I usually use DataAreaId to denote that this is a special range.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;qbr = qbd.addRange(FieldNum(CustTable, DataAreaId));&lt;/span&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;qbr.value(strFmt('((%1 == "4000") || (%2 == "The Bulb"))',&lt;/span&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;fieldStr(CustTable, AccountNum),&lt;/span&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;fieldStr(CustTable, Name)));&lt;/span&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;&lt;i&gt;Result&lt;/i&gt;&lt;/span&gt;:&amp;nbsp;SELECT * FROM CustTable WHERE ((((AccountNum == "4000") || (Name == "The Bulb"))))&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
The above result can also be obtained with this below example. The only difference is we are using DataSource name as well. This will also give you some idea on how to use expressions when more than one DataSources are involved.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="margin: 0px;"&gt;&lt;div style="margin: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;qbr = qbd.addRange(FieldNum(CustTable, DataAreaId));&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;div style="margin: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;qbr.value(strFmt('((%1.%2 == "4000") || (%1.%3 == "The Bulb"))',&lt;/span&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;qbd.name(),&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;div style="margin: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;fieldStr(CustTable, AccountNum),&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;div style="margin: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;fieldStr(CustTable, Name)));&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;i&gt;&lt;span class="Apple-style-span"&gt;&lt;i&gt;Result&lt;/i&gt;&lt;/span&gt;:&amp;nbsp;SELECT * FROM CustTable WHERE ((((CustTable_1.AccountNum == "4000") || (CustTable_1.Name == "The Bulb"))))&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;Query range value expressions are evaluated only at run time, so there is no compile-time checking. If the expression cannot be understood, a modal box will appear at run time that states "Unable to parse the value."&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Feel free to post any comment / feedback here.&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-9126440952980474587?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=l7G_9DAU3DQ:XP7Le_WqbIU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=l7G_9DAU3DQ:XP7Le_WqbIU:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=l7G_9DAU3DQ:XP7Le_WqbIU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=l7G_9DAU3DQ:XP7Le_WqbIU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=l7G_9DAU3DQ:XP7Le_WqbIU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=l7G_9DAU3DQ:XP7Le_WqbIU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=l7G_9DAU3DQ:XP7Le_WqbIU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/l7G_9DAU3DQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/9126440952980474587/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2010/03/query-extended-range-value-expression.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/9126440952980474587?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/9126440952980474587?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/l7G_9DAU3DQ/query-extended-range-value-expression.html" title="Dynamics Ax Query Extended Range Value Expression" /><author><name>Rahul Sharma</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://1.bp.blogspot.com/_XHhpkCare9U/S7aYwq92s-I/AAAAAAAAAHk/pWlRp8Z2lSo/S220/profile+pic.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.rahulsharma.in/2010/03/query-extended-range-value-expression.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkcAR3w-eCp7ImA9WxFbGUg.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-2059777550517329841</id><published>2009-12-29T16:59:00.012-05:00</published><updated>2010-07-12T14:07:26.250-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-12T14:07:26.250-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server Analysis Services" /><category scheme="http://www.blogger.com/atom/ns#" term="Axapta" /><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax BI" /><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server Reporting Services" /><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio .Net" /><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2009" /><title>Reporting Capabilities of MS Dynamics Ax 2009 - Part 3 (Visual Studio 2008 &amp; SSRS)</title><content type="html">This article is from a series of articles describing &lt;a href="http://blog.rahulsharma.in/2009/12/reporting-capabilities-of-ms-dynamics_14.html"&gt;Dynamics AX reporting capabilities&lt;/a&gt;. In this article we will see how developers can create &lt;b&gt;&lt;i&gt;SQL Server Reporting Services (SSRS) reports using Dynamics AX and Visual Studio 2008&lt;/i&gt;&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Prerequisites:&lt;/i&gt;&lt;br /&gt;
You must have &lt;b&gt;Dynamics AX&amp;nbsp;&lt;/b&gt;&lt;i&gt;&lt;b&gt;Reporting tools&lt;/b&gt;&lt;/i&gt;&amp;nbsp;installed on client from where you want to create and deploy report. You must also have access to the&amp;nbsp;&lt;i&gt;SSRS report server&lt;/i&gt;.&lt;br /&gt;
To know more about Dynamics AX installation requirement and procedure, follow this link... &lt;a href="http://www.microsoft.com/dynamics/en/us/using/ax-system-requirements-2009.aspx" target="_blank"&gt;Microsoft Dynamics Ax 2009.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Before we see how to create Dynamics AX SSRS reports, lets make it clear in our mind that Dynamics AX model-based SSRS reports are actually a superset of standard SSRS reports. It means you have everything you see in standard SSRS plus more advanced reporting features if you are creating SSRS report based on Dynamics AX SSRS approach.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/" name="more"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;Advantages using AX SSRS Reporting Tool over directly creating SSRS reports in SQL Server:&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;This tool provides a &lt;i&gt;&lt;b&gt;model-based approach&lt;/b&gt;&lt;/i&gt; for creating reports by providing project templates and modeling tools that are incorporated into the &lt;b&gt;&lt;i&gt;Visual Studio&lt;/i&gt;&lt;/b&gt; development environment.&lt;/li&gt;
&lt;li&gt;Reporting projects can be customized, upgraded, and patched using the &lt;b&gt;&lt;i&gt;built-in layering support&lt;/i&gt;&lt;/b&gt; in Dynamics AX. Reporting projects are added to the AOD in a packaged format in &lt;i&gt;&lt;b&gt;Report Libraries&lt;/b&gt;&lt;/i&gt;, this makes deployment easier. You can easily move them from development environment to production. These reports live with your AX code base.&lt;/li&gt;
&lt;li&gt;Default report &lt;b&gt;&lt;i&gt;Data Sources&lt;/i&gt;&lt;/b&gt; are Dynamics AX (for AX data) and Dynamics AX OLAP (for AX Analysis Services data), BUT it is not limited to this, you can use &lt;i&gt;ANY KIND of data source&lt;/i&gt; you want. There are more options to do so then usual SSRS approach. For example; you can access other DBs and stored procedures, Excel, text files, RSS / ATOM feeds or any kind of data source you can think of and display data from these data sources on your report. How about displaying live Currency Exchange Rates along with other AX data on report? :). OR you might want to use your own SQL Stored Procedure for some reason or the other to display data on your report. Options are only limited to your knowledge.&lt;/li&gt;
&lt;li&gt;Same standard Dynamics AX &lt;b&gt;&lt;i&gt;Security&lt;/i&gt;&lt;/b&gt; is available while running report including record-level security. NOTE: this feature is available to you, only if you are using default Dynamics AX datasources on report. If you are using your own stored procedures etc then there are some tricks that you can use to enforce AX security.&lt;/li&gt;
&lt;li&gt;It's really easy to &lt;b&gt;&lt;i&gt;write business logic&lt;/i&gt;&lt;/b&gt; in report using C# / VB.Net. This makes it possible for you to have full .Net framework access and utilize the &lt;b&gt;&lt;i&gt;power of .Net&lt;/i&gt;&lt;/b&gt; in whatever manner you want&amp;nbsp;and this is all&amp;nbsp;&lt;i&gt;&lt;b&gt;re-usable&lt;/b&gt;&lt;/i&gt;&amp;nbsp;in other reports. It also means you can access Dynamics AX business logic in your report, and sometimes much needed X++ calculated business logic fields. On the other hand, If you are creating SSRS reports directly and not using Dynamics AX SSRS tools then you would have to 're-create the wheel' and duplicate that AX logic through T-SQL or SQL Scalar Functions and manage it if business requirement changes.&amp;nbsp;:)&lt;/li&gt;
&lt;li&gt;Reports can be displayed anywhere and not only limited to the Dynamics AX rich client, Role Centers (Dashboards) and Enterprise Portal.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Rapid report development&lt;/b&gt;. Using this approach, you can create reports using &lt;i&gt;&lt;b&gt;auto-design&lt;/b&gt;&lt;/i&gt; feature. This feature automatically creates a report design based on the report data. OR for more precise design you can use &lt;i&gt;&lt;b&gt;SQL Report Designer&lt;/b&gt;&lt;/i&gt;.&lt;/li&gt;
&lt;li&gt;Use style templates to give your reports &lt;i&gt;&lt;b&gt;consistent look and feel&lt;/b&gt;&lt;/i&gt;.&lt;/li&gt;
&lt;li&gt;Report &lt;i&gt;&lt;b&gt;localization &lt;/b&gt;&lt;/i&gt;using standard .Net practice.&lt;/li&gt;
&lt;li&gt;See &lt;b&gt;&lt;i&gt;preview&lt;/i&gt;&lt;/b&gt; of your reports at design time in Visual Studio.&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;If you still have reasons to use standard SQL SSRS to build reports for AX and dont want to go with this cool advanced Dynamics AX SSRS approach then in this case I cannot help you guys.&amp;nbsp;Others who are still with me and want to utilize Dynamics AX SSRS approach, continue reading. :)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
In this article we will see how to create a simple Dynamics AX SSRS report using Visual Studio 2008 Dynamics AX reporting tools. Instead of jumping on AX data to see how it looks in SSRS, lets see how things work in this new AX SSRS model. In this way, you will be able to create reports based on AX or any other data repository in minutes.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;b&gt;Create Report&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;h2&gt;&lt;span class="Apple-style-span" style="font-size: medium; font-weight: bold;"&gt;Step 1: Create Report Project in VS&lt;/span&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Launch VS 2008.&lt;/li&gt;
&lt;li&gt;File - New - Project. The New Project dialog will open.&amp;nbsp;Under Project Types, select Visual C# &amp;nbsp;/ Dynamics.&amp;nbsp;Under Templates select &lt;b&gt;Dynamics AX Reporting Project&lt;/b&gt;. Rename project if you want.&lt;/li&gt;
&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_XHhpkCare9U/TDioYRQwVCI/AAAAAAAACtY/YYKfqVgz5lc/s1600/AxSSRS_NewProject1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="268" src="http://4.bp.blogspot.com/_XHhpkCare9U/TDioYRQwVCI/AAAAAAAACtY/YYKfqVgz5lc/s400/AxSSRS_NewProject1.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;New report project is created with one blank report named Report1.moxl. Rename report if you want.&amp;nbsp;This is actually your &lt;b&gt;Report Model.&lt;/b&gt;&amp;nbsp;Model is a container for all of your report elements and defines your report definition, with file extension .moxl. To open model editor double click on .moxl file in solution explorer. A model contains various elements that define report. Most importantly you can re-use model on another report model. The model is contained in an assembly named on your project, in our case it would be 'DynamicsReportsLibrary1.Model.dll'.&lt;br /&gt;
&lt;/li&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_XHhpkCare9U/TDi8Q5nOmbI/AAAAAAAACtg/7V1RY5kbGN0/s1600/AxSSRS1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="130" src="http://4.bp.blogspot.com/_XHhpkCare9U/TDi8Q5nOmbI/AAAAAAAACtg/7V1RY5kbGN0/s400/AxSSRS1.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h3&gt;Model Elements:   &lt;/h3&gt;&lt;table class="rahTable"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Elements&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Report&lt;/td&gt;&lt;td&gt;This is your report definition. A report definition contains a collection of elements such as datasets, parameters, images, and report designs.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Report Data Source&lt;/td&gt;&lt;td&gt;This is a source of data for your report's dataset. Default Dynamics AX data source gives you access to the Dynamics AX application data. Again, you can define your own data source to connect to other data repositories.&amp;nbsp;Default data sources are, Dynamics AX and DynamicsAXOLAP (requires SharedLibrary and Components from AOT\Report Libraries).&amp;nbsp;Custom data sources can be defined against an existing DB/OLAP.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Dataset&lt;/td&gt;&lt;td&gt;A dataset identifies data that is displayed in a report. Every report must have one or more datasets. Once you define dataset, you also need to tell how you want to fetch data.&amp;nbsp;Dynamics AX data source can be of two types, Query (AX Query) or Business Logic (Data Methods). DynamicsAXOLAP data source can execute your MDX query against AX.&amp;nbsp;Custom data sources can be of type TSQL / Stored Procedure / MDX.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Data Method&lt;/td&gt;&lt;td&gt;Here you will write code in C# / VB.Net to retrieve or process your data. Also all other type of data that you can not fetch using your data source, can be&amp;nbsp;retrieved&amp;nbsp;through these methods.&lt;br /&gt;
The issue you should be aware of with a data method is that it has to construct a full DataTable for the report. If your datasets are huge, then your DataTable will be huge and it may affect the performance of your reports.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Data Region&lt;/td&gt;&lt;td&gt;A data region is an area within a report that displays data. Data can be displayed in table, list, matrix, or chart formats.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Parameter&lt;/td&gt;&lt;td&gt;You define report parameter here.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Filter&lt;/td&gt;&lt;td&gt;Restrict the data that is displayed in a report.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Grouping&lt;/td&gt;&lt;td&gt;Records Grouping.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Sorting&lt;/td&gt;&lt;td&gt;Records Sorting.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Image&lt;/td&gt;&lt;td&gt;Image display.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Auto Design&lt;/td&gt;&lt;td&gt;An auto design is a report design that is automatically generated based on the report data. An auto design is created by dragging and dropping, and selecting elements using Model Editor.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Precision Design&lt;/td&gt;&lt;td&gt;A precision design is a report design that is created using SQL Report Designer. Precision designs are useful when a very precise layout is required.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Layout Template&lt;/td&gt;&lt;td&gt;A layout template specifies the styles that are applied to the header, footer, and body of a report. One layout template can be applied to many reports.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Style Template&lt;/td&gt;&lt;td&gt;A style template specifies the styles that are applied to a data region.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/ul&gt;&lt;span class="Apple-style-span" style="font-size: medium; font-weight: bold;"&gt;Step 2: Create Data Method&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Create a Data Method that will provide data to our DataSet.&lt;/li&gt;
&lt;li&gt;In model editor, right click on &lt;i&gt;Data Methods node&lt;/i&gt; under Report1 and select '&lt;i&gt;Add Data Methods&lt;/i&gt;'. This will add a new data methods names DataMethod1.&lt;/li&gt;
&lt;li&gt;To write code in this method, double click or right click and select '&lt;i&gt;View Code&lt;/i&gt;'. It will open a C# code file for you to edit named '&lt;i&gt;Report1.BusinessLogic.cs&lt;/i&gt;'. The logic is saved in an assembly named on your project, in our case it would be '&lt;i&gt;DynamicsReportsLibrary1.BusinessLogic.dll&lt;/i&gt;'. So, this can also be reused in other projects as well.&lt;/li&gt;
&lt;li&gt;Change code as below for your method so that we can return some dummy rows. you can also use this trick, if you want to return data from a data source that can not be handled by your report data source, such as RSS feeds:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Report1&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    [DataMethod(), AxSessionPermission(SecurityAction.Assert)]&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; DataTable DataMethod1()&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;        &lt;span class="rem"&gt;//create a table structure as we want to display it on report table&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;        var dt = &lt;span class="kwrd"&gt;new&lt;/span&gt; DataTable();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;        dt.Columns.Add(&lt;span class="str"&gt;"CustID"&lt;/span&gt;, &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(&lt;span class="kwrd"&gt;string&lt;/span&gt;));&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        dt.Columns.Add(&lt;span class="str"&gt;"Name"&lt;/span&gt;, &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(&lt;span class="kwrd"&gt;string&lt;/span&gt;));&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        dt.Columns.Add(&lt;span class="str"&gt;"Age"&lt;/span&gt;, &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(&lt;span class="kwrd"&gt;int&lt;/span&gt;));&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        &lt;span class="rem"&gt;//add data. you can use any source to get your data.&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;        DataRow dr;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;        &lt;span class="rem"&gt;//add new row&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;        dr = dt.NewRow();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;        &lt;span class="rem"&gt;//Columns required for data&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        dr[&lt;span class="str"&gt;"CustID"&lt;/span&gt;] = &lt;span class="str"&gt;"R001"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;        dr[&lt;span class="str"&gt;"Name"&lt;/span&gt;] = &lt;span class="str"&gt;"Rahul Sharma"&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;        dr[&lt;span class="str"&gt;"Age"&lt;/span&gt;] = 30;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;        dt.Rows.Add(dr);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;        &lt;span class="rem"&gt;//add another row&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;        dr = dt.NewRow();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;        dr[&lt;span class="str"&gt;"CustID"&lt;/span&gt;] = &lt;span class="str"&gt;"R002"&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;        dr[&lt;span class="str"&gt;"Name"&lt;/span&gt;] = &lt;span class="str"&gt;"Rocky Sharma"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;        dr[&lt;span class="str"&gt;"Age"&lt;/span&gt;] = 30;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;        dt.Rows.Add(dr);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;        &lt;span class="rem"&gt;//return table with records&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; dt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;}&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium; font-weight: bold;"&gt;Step 3: Create Dataset&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Create a dataset for your report. Right click on your &lt;i&gt;Datasets node&lt;/i&gt; in model editor and '&lt;i&gt;Add Dataset&lt;/i&gt;'. Here you will specify which report data source you gonna use for data. In our case, we are using a DataMethod to return a table with rows. Change &lt;b&gt;Data Source Type&lt;/b&gt; property to '&lt;i&gt;Business Logic&lt;/i&gt;' and &lt;b&gt;Query&lt;/b&gt; property to '&lt;i&gt;DataMethod1&lt;/i&gt;'.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_XHhpkCare9U/TDjL4rbFvNI/AAAAAAAACto/IfKpp5qFpm0/s1600/AxSSRS2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="262" src="http://2.bp.blogspot.com/_XHhpkCare9U/TDjL4rbFvNI/AAAAAAAACto/IfKpp5qFpm0/s400/AxSSRS2.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;You can see that the Dataset has picked up the fields from the DataTable automatically.&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium; font-weight: bold;"&gt;Step 4: Create Design&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Now there are various ways to create you report design but the simple one is to utilize '&lt;b&gt;Auto Design&lt;/b&gt;' feature. Most of the reports can be built this way.&lt;/li&gt;
&lt;li&gt;In model editor, drag the dataset created in step 2, to Design node of your report. After this your model should like look this.&lt;br /&gt;
&lt;/li&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_XHhpkCare9U/TDjObIaULUI/AAAAAAAACtw/s5HeYhsNhUU/s1600/AxSSRS3.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://3.bp.blogspot.com/_XHhpkCare9U/TDjObIaULUI/AAAAAAAACtw/s5HeYhsNhUU/s400/AxSSRS3.JPG" width="201" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;li&gt;That's it, you are done with your AX SSRS report.&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium; font-weight: bold;"&gt;Step 5: Preview Report&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Right click on your 'AutoDesign1' and select &lt;i&gt;preview&lt;/i&gt;.&lt;br /&gt;
&lt;/li&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_XHhpkCare9U/TDjPhERQjCI/AAAAAAAACt4/20e2lUGQqM0/s1600/AxSSRS4.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="168" src="http://3.bp.blogspot.com/_XHhpkCare9U/TDjPhERQjCI/AAAAAAAACt4/20e2lUGQqM0/s640/AxSSRS4.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;li&gt;Design has some validation warning as we are not using any style or template to bind our report design.&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;This was a very simple report to start with but now you have idea what you gonna do next and how.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;AX SSRS Report with AX Query data source:&lt;/h3&gt;If you want to create a report that fetches data from AX Query then use following steps:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Create an AX Query&lt;/li&gt;
&lt;li&gt;Create a new AX Reports Project and a new report in that project&lt;/li&gt;
&lt;li&gt;Create a dataset in the report bound to that query&lt;/li&gt;
&lt;li&gt;Create a design to report to render the dataset&lt;/li&gt;
&lt;li&gt;Preview the design&lt;/li&gt;
&lt;li&gt;Deploy the design to SSRS&lt;/li&gt;
&lt;li&gt;View the report via IE&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Save the Report project back into AX&lt;/b&gt;. Right click on your project in solution explorer and select save to AOD. This process uses your current Ax client configuration to determine where to save your report package and on which layer.&lt;br /&gt;
&lt;/li&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_XHhpkCare9U/TDjTid0O2uI/AAAAAAAACuA/2NP6HmZTOfc/s1600/AxSSRS5.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://2.bp.blogspot.com/_XHhpkCare9U/TDjTid0O2uI/AAAAAAAACuA/2NP6HmZTOfc/s400/AxSSRS5.JPG" width="222" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;li&gt;&lt;b&gt;&lt;i&gt;Edit the report saved in the AOT&lt;/i&gt;&lt;/b&gt;. Open AX - AOT/ Report Library/ReportProject and right click and select '&lt;i&gt;&lt;b&gt;Edit in Visual Studio&lt;/b&gt;&lt;/i&gt;'.&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;&lt;br /&gt;
Use non-AX data source:&lt;/h3&gt;If you want to fetch data from other DBs or from a stored procedure use this.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Right click on your project in solution explorer, and select '&lt;i&gt;Add - New Item&lt;/i&gt;'. Select '&lt;i&gt;&lt;b&gt;Report Data Source&lt;/b&gt;&lt;/i&gt;'.&lt;br /&gt;
&lt;/li&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_XHhpkCare9U/TDjbzWZaieI/AAAAAAAACuI/Y6LzI6PDH3k/s1600/AxSSRS6.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="233" src="http://2.bp.blogspot.com/_XHhpkCare9U/TDjbzWZaieI/AAAAAAAACuI/Y6LzI6PDH3k/s400/AxSSRS6.JPG" width="400" /&gt;&lt;/a&gt; &lt;/div&gt;
&lt;li&gt;Select provider SQL / OLAP.&lt;/li&gt;
&lt;li&gt;Specify Connection string.&lt;/li&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_XHhpkCare9U/TDjb5qiNs-I/AAAAAAAACuQ/dGzrM913Ld4/s1600/AxSSRS7.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="258" src="http://2.bp.blogspot.com/_XHhpkCare9U/TDjb5qiNs-I/AAAAAAAACuQ/dGzrM913Ld4/s400/AxSSRS7.JPG" width="400" /&gt;&lt;/a&gt; &lt;/div&gt;
&lt;li&gt;Open your report and create a dataset.&lt;/li&gt;
&lt;li&gt;Select data source you created above and how you want to use it. Specify if you want to use MDX, T-SQL or Stored Procedure with this data source.&lt;/li&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_XHhpkCare9U/TDjcMAqvgzI/AAAAAAAACuY/MEdT_xtyfa8/s1600/AxSSRS8.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="261" src="http://2.bp.blogspot.com/_XHhpkCare9U/TDjcMAqvgzI/AAAAAAAACuY/MEdT_xtyfa8/s400/AxSSRS8.JPG" width="400" /&gt;&lt;/a&gt; &lt;/div&gt;
&lt;li&gt;Use this on your report. :)&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
That's it for now. Check this space again for more on AX SSRS Reporting.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Feel free to post your feedback / comments / queries here.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;"&gt;&lt;b&gt;References:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href="http://blog.rahulsharma.in/2009/12/reporting-capabilities-of-ms-dynamics_14.html" target="_blank"&gt;Reporting Capabilities of MS Dynamics Ax 2009 - Part 1 (Ax Report Wizard)&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://blog.rahulsharma.in/2009/12/reporting-capabilities-of-ms-dynamics_15.html" target="_blank"&gt;Reporting Capabilities of MS Dynamics Ax 2009 - Part 2 (SSRS Report Builder)&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://blog.rahulsharma.in/2009/11/activex-gantt-chart-control-in-dynamics.html" target="_blank"&gt;ActiveX Gantt Chart control in Dynamics Ax&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://blogs.msdn.com/b/saveenr/archive/2010/05/01/how-to-be-productive-with-ssrs-and-dynamics-ax-2009-a-new-approach.aspx" target="_blank"&gt;How to be productive with SSRS and Dynamics AX 2009: A new approach&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-2059777550517329841?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=FNAuTthnxfc:yWP0ElqiXaA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=FNAuTthnxfc:yWP0ElqiXaA:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=FNAuTthnxfc:yWP0ElqiXaA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=FNAuTthnxfc:yWP0ElqiXaA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=FNAuTthnxfc:yWP0ElqiXaA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=FNAuTthnxfc:yWP0ElqiXaA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=FNAuTthnxfc:yWP0ElqiXaA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/FNAuTthnxfc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/2059777550517329841/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2009/12/reporting-capabilities-of-ms-dynamics.html#comment-form" title="8 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/2059777550517329841?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/2059777550517329841?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/FNAuTthnxfc/reporting-capabilities-of-ms-dynamics.html" title="Reporting Capabilities of MS Dynamics Ax 2009 - Part 3 (Visual Studio 2008 &amp;amp; SSRS)" /><author><name>Rahul Sharma</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://1.bp.blogspot.com/_XHhpkCare9U/S7aYwq92s-I/AAAAAAAAAHk/pWlRp8Z2lSo/S220/profile+pic.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_XHhpkCare9U/TDioYRQwVCI/AAAAAAAACtY/YYKfqVgz5lc/s72-c/AxSSRS_NewProject1.JPG" height="72" width="72" /><thr:total>8</thr:total><feedburner:origLink>http://blog.rahulsharma.in/2009/12/reporting-capabilities-of-ms-dynamics.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkIFRno6fip7ImA9WhZUEE4.&quot;"><id>tag:blogger.com,1999:blog-2122347489242910711.post-5722307998794514305</id><published>2009-12-22T14:23:00.002-05:00</published><updated>2011-06-02T13:08:37.416-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-02T13:08:37.416-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Axapta" /><category scheme="http://www.blogger.com/atom/ns#" term="Debugging" /><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 4.0" /><category scheme="http://www.blogger.com/atom/ns#" term="MS Dynamics Ax 2009" /><title>Get MS Dynamics Ax Call Stack in X++ Code</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Sometimes it is really useful to know the &lt;b&gt;&lt;i&gt;Dynamics Ax call stack for debugging&lt;/i&gt;&lt;/b&gt; purposes. For example if you want to debug a scenario where user is doing something and getting weird results and you know which method is causing it but you are not sure when it is being called and moreover from which place in Dynamics Ax.&lt;br /&gt;
&lt;br /&gt;
You can create a static method in Global / Info class or wherever you want and call it within the debugging method. When the method is called you will see a InfoLog about the call stack. Though this example shows you an InfoLog but you can use any destination for your output and optionally add time-stamp to it.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/" name="more"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_J7zqOed3bnY/SzEcr9YV-DI/AAAAAAAAGdE/H0-p-ZY1O1o/s1600-h/AxCallStackJob.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="220" src="http://4.bp.blogspot.com/_J7zqOed3bnY/SzEcr9YV-DI/AAAAAAAAGdE/H0-p-ZY1O1o/s400/AxCallStackJob.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
I hope this article helps you someway in debugging x++.&lt;br /&gt;
&lt;br /&gt;
Feel free to post any comment / feedback here.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;br/&gt;&lt;b&gt;Join me on &lt;a href="http://fb.rahulsharma.in" target="_blank"&gt;facebook&lt;/a&gt; | &lt;a href="http://twitter.rahulsharma.in" target="_blank"&gt;twitter&lt;/a&gt; | &lt;a href="http://linkedin.rahulsharma.in" target="_blank"&gt;linkedin&lt;/a&gt; !!!&lt;/b&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2122347489242910711-5722307998794514305?l=blog.rahulsharma.in' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=KOYYSYNwtXs:usThLHbKVeM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=KOYYSYNwtXs:usThLHbKVeM:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=KOYYSYNwtXs:usThLHbKVeM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=KOYYSYNwtXs:usThLHbKVeM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=KOYYSYNwtXs:usThLHbKVeM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?a=KOYYSYNwtXs:usThLHbKVeM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Rahul-Sharma/Blog?i=KOYYSYNwtXs:usThLHbKVeM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Rahul-Sharma/Blog/~4/KOYYSYNwtXs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rahulsharma.in/feeds/5722307998794514305/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.rahulsharma.in/2009/12/get-ms-dynamics-ax-call-stack-in-x-code.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/5722307998794514305?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2122347489242910711/posts/default/5722307998794514305?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Rahul-Sharma/Blog/~3/KOYYSYNwtXs/get-ms-dynamics-ax-call-stack-in-x-code.html" title="Get MS Dynamics Ax Call Stack in X++ Code" /><author><name>Rahul Sharma</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="25" height="32" src="http://1.bp.blogspot.com/_XHhpkCare9U/S7aYwq92s-I/AAAAAAAAAHk/pWlRp8Z2lSo/S220/profile+pic.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_J7zqOed3bnY/SzEcr9YV-DI/AAAAAAAAGdE/H0-p-ZY1O1o/s72-c/AxCallStackJob.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.rahulsharma.in/2009/12/get-ms-dynamics-ax-call-stack-in-x-code.html</feedburner:origLink></entry></feed>

