<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
<channel>
<title>Avanade xRM Blog</title>
<link>http://www.avanadeblog.com/xrm/</link>
<description>Avanade provides business technology services that connect insight, innovation and expertise in Microsoft technologies to help customers realize results. Avanade’s services and solutions help improve performance, productivity and sales for organizations in all industries. </description>
<language>en-US</language>
<lastBuildDate>Sat, 27 Aug 2011 11:06:47 -0700</lastBuildDate>
<generator>http://www.typepad.com/</generator>

<docs>http://www.rssboard.org/rss-specification</docs>
<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/AvanadeXrmBlog" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="avanadexrmblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
<title>Error Logging Plug-in Exceptions in CRM Online</title>
<link>http://www.avanadeblog.com/xrm/2011/08/error-logging-plug-in-exceptions-in-crm-online.html</link>
<guid isPermaLink="true">http://www.avanadeblog.com/xrm/2011/08/error-logging-plug-in-exceptions-in-crm-online.html</guid>
<description>For a while now we've been trying to find some way of logging plug-in exceptions on CRM Online (and I've also seen a number of posts on the CRM Developer forums asking if this is possible). Logging exceptions that originate from CRM plug-ins presents a number of problems, especially in...</description>
<content:encoded>&lt;p&gt;For a while now we&amp;#39;ve been trying to find some way of logging plug-in exceptions on CRM Online (and I&amp;#39;ve also seen a number of &lt;a href="http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/3bbe3cc0-e2a7-461d-87a2-f150b1698bb4" target="_self"&gt;posts&lt;/a&gt; on the CRM Developer forums asking if this is possible).&amp;#0160;&lt;/p&gt;
&lt;p&gt;Logging exceptions that originate from CRM plug-ins presents a number of problems, especially in CRM online.&amp;#0160; First of all, plug-ins in CRM online are sand-boxed, so you do not have access to the file system or event log.&amp;#0160; The CRM SDK offers a tracing service that can be used, but this only displays tracing information to the end user.&amp;#0160; No permanent log of the exception is recorded.&amp;#0160;&lt;/p&gt;
&lt;p&gt;The logical solution is to just write all exception messages to a custom CRM entity (The SDK even &lt;a href="http://msdn.microsoft.com/en-us/library/gg328574.aspx#loggingandtracing" target="_self"&gt;mentions this idea&lt;/a&gt;).&amp;#0160; But this is also problematic because synchronous plug-ins are run inside of a database transaction. So if your plug-in runs into an exception the transaction will get rolled back, including rolling back the creation of any Error Log record you created while handling the exception.&amp;#0160;&lt;/p&gt;
&lt;p&gt;Ideally, we want all of the operations of the plug-in to be inside the database transaction, but the creation of the errorlog record to &lt;em&gt;NOT &lt;/em&gt;be part of the transaction (so that any changes made by the plug-in are rolled back, but an admin can still read the error message afterwards). This can be achieved in an on-premise CRM installation by just creating a new OrganizationService proxy from scratch, instead of using the one provided by the plugin context. But again, this doesn&amp;#39;t work in CRM Online because of the sandbox restrictions (when running in partial trust you cannot make WCF calls or use the libraries included in the CRM SDK for connecting to CRM online).&lt;/p&gt;
&lt;p&gt;Fortunately, there is a different way to connect to CRM online while in partial-trust, and the answer comes from &lt;a href="http://www.dynamicslight.com/2010/04/mscrm-development-tips-tricks-3-connecting-to-mscrm-online/" target="_self" title="mscrm development tips and tricks - connecting to mscrm online"&gt;this post&lt;/a&gt; on Dimaz Pramudya&amp;#39;s blog.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;&lt;span style="color: #0080ff;"&gt;There is a sample on how to achieve this using Passport authentication in MSCRM SDK. ... it failed miserably in  shared hosting environment which runs Medium or High trust level.&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span style="color: #0080ff;"&gt;What I wanted to share today is an alternative way to get the Windows Live Id ticket that works virtually on any environment.&amp;#0160; This method uses the RPS (Relying Party Suites) authentication option for Windows Live.&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This post is over a year old, and only describes connecting to the CRM 4.0 webservicce, but it will still work with CRM 2011 online.&lt;/p&gt;
&lt;p&gt;Dimaz has created two c# classes; &lt;em&gt;LiveIdTicketAcquirer &lt;/em&gt;and &lt;em&gt;CrmOnlineQueryManager&lt;/em&gt;, which together can be used to connect to CRM online from within a CRM plug-in.&amp;#0160; And this new connection will not be part of the database transaction, which means it can be used to write our error log messages back to a CRM entity.&lt;/p&gt;
&lt;p&gt;In the following code sample I am using the CrmOnlineQueryManager to log an exception to a custom entity called &amp;quot;new_error&amp;quot;:&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 9pt; font-family: Consolas; color: blue;"&gt;public&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Consolas;"&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;TestPlugin&lt;/span&gt; : &lt;span style="color: #2b91af;"&gt;IPlugin&lt;/span&gt;&lt;br /&gt;{&lt;span&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Execute(&lt;span style="color: #2b91af;"&gt;IServiceProvider&lt;/span&gt; serviceProvider)&lt;span&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;{&lt;span&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;{&lt;span&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;throw&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Exception&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;&amp;quot;Testing Error logging&amp;quot;&lt;/span&gt;);&lt;span&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;}&lt;span&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;catch&lt;/span&gt;( &lt;span style="color: #2b91af;"&gt;Exception&lt;/span&gt; ex)&lt;span&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;{&lt;span&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;CrmOnlineErrorLogger&lt;/span&gt;.LogError(ex);&lt;span&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;throw&lt;/span&gt;;&lt;span&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;}&lt;span&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; font-family: Consolas; color: blue;"&gt;class&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Consolas;"&gt; &lt;span style="color: #2b91af;"&gt;CrmOnlineErrorLogger&lt;/span&gt;&lt;br /&gt;{&lt;span&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;const&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; username = &lt;span style="color: #a31515;"&gt;&amp;quot;myLiveId&amp;quot;&lt;/span&gt;;&lt;span&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;const&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; password = &lt;span style="color: #a31515;"&gt;&amp;quot;myPassword&amp;quot;&lt;/span&gt;;&lt;span&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;const&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; organization = &lt;span style="color: #a31515;"&gt;&amp;quot;myOrgName&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 9pt; font-family: Consolas;"&gt;&lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; LogError(&lt;span style="color: #2b91af;"&gt;Exception&lt;/span&gt; ex)&lt;span&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;{&lt;span&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;CrmOnlineQueryManager&lt;/span&gt; queryManager = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;CrmOnlineQueryManager&lt;/span&gt;();&lt;span&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;var&lt;/span&gt; crmService = queryManager.Connect(username, password, organization);&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 9pt; font-family: Consolas;"&gt;&lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;DynamicEntity&lt;/span&gt; entity = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;DynamicEntity&lt;/span&gt;();&lt;span&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;entity.Name = &lt;span style="color: #a31515;"&gt;&amp;quot;new_error&amp;quot;&lt;/span&gt;; &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 9pt; font-family: Consolas;"&gt;&lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;StringProperty&lt;/span&gt; exceptionType = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;StringProperty&lt;/span&gt;() { Name = &lt;span style="color: #a31515;"&gt;&amp;quot;new_exceptiontype&amp;quot;&lt;/span&gt;, Value = ex.GetType().FullName };&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 9pt; font-family: Consolas;"&gt;&lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;StringProperty&lt;/span&gt; details = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;StringProperty&lt;/span&gt;() { Name = &lt;span style="color: #a31515;"&gt;&amp;quot;new_details&amp;quot;&lt;/span&gt;, Value = ex.Message + &lt;span style="color: #a31515;"&gt;&amp;quot;: &amp;quot;&lt;/span&gt; + ex.StackTrace };&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 9pt; font-family: Consolas;"&gt;&lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;entity.Properties = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Property&lt;/span&gt;[] { exceptionType, details };&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 9pt; font-family: Consolas;"&gt;&lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;crmService.Create(entity);&lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;When I run this plug-in, the thrown exception rolls back the update I was making, and I see the expected error message:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.avanadeblog.com/.a/6a0120a757f751970b01539107ac09970b-pi" style="display: inline;"&gt;&lt;img alt="ErrorLogging1" class="asset  asset-image at-xid-6a0120a757f751970b01539107ac09970b" src="http://www.avanadeblog.com/.a/6a0120a757f751970b01539107ac09970b-600wi" style="width: 600px;" title="ErrorLogging1" /&gt;&lt;/a&gt; &lt;br /&gt; &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;But I also see a log of the exception in my custom &amp;quot;Errors&amp;quot; table:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.avanadeblog.com/.a/6a0120a757f751970b015434db2b44970c-pi" style="display: inline;"&gt;&lt;img alt="ErrorLogging2" class="asset  asset-image at-xid-6a0120a757f751970b015434db2b44970c" src="http://www.avanadeblog.com/.a/6a0120a757f751970b015434db2b44970c-850wi" style="width: 850px;" title="ErrorLogging2" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So now we can do error logging on CRM Online.&amp;#0160; Of course, this is just a proof of concept. There&amp;#39;s a few more steps we would need to take before using this in a production environment..&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;This code still connects to the old CRM 4.0 webservice. Presumably a similar connector could be made that uses the 2011 endpoint. &lt;/li&gt;
&lt;li&gt;There may be performance issues.&amp;#0160; I&amp;#39;ve noticed its a bit slow to log errors, but a lot of the slowdown can be reduced by trimming the crm4 webservice proxy class down to just the minimum components needed.&amp;#0160; Also, the slowdown only occurs when the plug-in actually throws an error, which may be acceptable.&amp;#0160; Bottom line, this technique still needs to be fully tested.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The code for this proof of concept can be found&amp;#0160;&lt;span class="asset  asset-generic at-xid-6a0120a757f751970b015434e0388e970c"&gt;&lt;a href="http://www.avanadeblog.com/files/crmonlineerrorlogging.zip"&gt;Here&lt;/a&gt;&lt;/span&gt;&lt;em&gt;.&lt;br /&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;~Erik Pool&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #888888;"&gt;&amp;#0160;&lt;strong&gt;&lt;em&gt;This posting is provided &amp;quot;AS IS&amp;quot; with no warranties, and confers no rights.&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;#0160;&lt;/p&gt;
&lt;ol&gt; &lt;/ol&gt;
&lt;div class="mcePaste" id="_mcePaste" style="position: absolute; left: -10000px; top: 841px; width: 1px; height: 1px; overflow: hidden;"&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; color: blue;"&gt;public&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;TestPlugin&lt;/span&gt; : &lt;span style="color: #2b91af;"&gt;IPlugin&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Execute(&lt;span style="color: #2b91af;"&gt;IServiceProvider&lt;/span&gt; serviceProvider)&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;throw&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Exception&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;&amp;quot;Testing Error logging&amp;quot;&lt;/span&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;catch&lt;/span&gt;( &lt;span style="color: #2b91af;"&gt;Exception&lt;/span&gt; ex)&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 3;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;CrmOnlineErrorLogger&lt;/span&gt;.LogError(ex);&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;throw&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; color: blue;"&gt;&amp;#0160;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; color: blue;"&gt;&amp;#0160;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; color: blue;"&gt;class&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt; &lt;span style="color: #2b91af;"&gt;CrmOnlineErrorLogger&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;const&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; username = &lt;span style="color: #a31515;"&gt;&amp;quot;magiccrm@hotmail.com&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;const&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; password = &lt;span style="color: #a31515;"&gt;&amp;quot;p@ss1word&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;const&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; organization = &lt;span style="color: #a31515;"&gt;&amp;quot;crmNAorg613b0&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&amp;#0160;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; LogError(&lt;span style="color: #2b91af;"&gt;Exception&lt;/span&gt; ex)&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;CrmOnlineQueryManager&lt;/span&gt; queryManager = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;CrmOnlineQueryManager&lt;/span&gt;();&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;var&lt;/span&gt; crmService = queryManager.Connect(username, password, organization);&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;#0160;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;DynamicEntity&lt;/span&gt; entity = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;DynamicEntity&lt;/span&gt;();&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;entity.Name = &lt;span style="color: #a31515;"&gt;&amp;quot;new_error&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&amp;#0160;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;StringProperty&lt;/span&gt; exceptionType = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;StringProperty&lt;/span&gt;() { Name = &lt;span style="color: #a31515;"&gt;&amp;quot;new_exceptiontype&amp;quot;&lt;/span&gt;, Value = ex.GetType().FullName };&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;StringProperty&lt;/span&gt; details = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;StringProperty&lt;/span&gt;() { Name = &lt;span style="color: #a31515;"&gt;&amp;quot;new_details&amp;quot;&lt;/span&gt;, Value = ex.Message + &lt;span style="color: #a31515;"&gt;&amp;quot;: &amp;quot;&lt;/span&gt; + ex.StackTrace };&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;entity.Properties = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Property&lt;/span&gt;[] { exceptionType, details };&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&amp;#0160;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;crmService.Create(entity);&lt;span style="mso-tab-count: 3;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&amp;#0160;&lt;/p&gt;
&lt;/div&gt;</content:encoded>


<category>CRM 2011</category>
<category>CRM Development</category>
<category>Errors</category>

<dc:creator>Erik Pool</dc:creator>
<pubDate>Sat, 27 Aug 2011 11:06:47 -0700</pubDate>

</item>
<item>
<title>CRM 2011 Form Navigation</title>
<link>http://www.avanadeblog.com/xrm/2011/06/crm-2011-form-navigation.html</link>
<guid isPermaLink="true">http://www.avanadeblog.com/xrm/2011/06/crm-2011-form-navigation.html</guid>
<description>One of the new features in CRM 2011 is the ability to finally define multiple forms for a single entity. CRM allows you to determine which form a user sees in two ways: Based on the Role of the current user. (The system administrator defines which roles have permission to...</description>
<content:encoded>&lt;p&gt;One of the new features in CRM 2011 is the ability to finally define multiple forms for a single entity.&amp;#0160; CRM allows you to determine which form a user sees in two ways:&lt;br /&gt; &lt;br /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Based on the Role of the current user.&amp;#0160; (The system administrator defines which roles have permission to view each form)&lt;/li&gt;
&lt;li&gt;The user can switch between multiple forms using a dropdown menu.&amp;#0160; CRM will automatically remember which form the user last selected and show them the same form the next time they open a record.&lt;br /&gt; &lt;a href="http://www.avanadeblog.com/.a/6a0120a757f751970b015432ec96b4970c-pi" style="display: inline;"&gt;&lt;img alt="FormSelector" class="asset  asset-image at-xid-6a0120a757f751970b015432ec96b4970c" src="http://www.avanadeblog.com/.a/6a0120a757f751970b015432ec96b4970c-320wi" style="width: 312px; border: 1px solid #000000;" title="FormSelector" /&gt;&lt;/a&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt; &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;However, what if you want to determine which form a user sees based on some other criteria? There are a few things you can do…&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to the URL for a specific form.&amp;#0160; Forms can be &lt;a href="http://msdn.microsoft.com/en-us/library/gg328483.aspx"&gt;navigated to directly by using a URL&lt;/a&gt; in the following format (the part in red is the ID of the form you want to display):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new,courier;"&gt;http://mycrm/myOrg/main.aspx?etn=account&amp;amp;pagetype=entityrecord&amp;amp;extraqs=formid%3D&lt;span style="color: #ff0000;"&gt;6009c1fe-ae99-4a41-a59f-a6f1cf8b9daf&lt;/span&gt;%0D%0A&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;/li&gt;
&lt;li&gt;After a form is loaded, you can &lt;a href="http://msdn.microsoft.com/en-us/library/bcf42b09-b672-4f4b-b866-ea7b24cc3ae0#BKMK_navigate"&gt;use javascript to navigate to another&lt;/a&gt; form:&amp;#0160;&amp;#0160; Xrm.Page.ui.formSelector.items.get(itemId).navigate();&lt;br /&gt; &lt;br /&gt; &lt;/li&gt;
&lt;li&gt;The previous 2 options will work, but are not without their problems.&amp;#0160; &lt;ol&gt;
&lt;li&gt;Navigating to a form using JavaScript presents a performance problem; basically the form has to be loaded twice whenever a user opens a record. &lt;/li&gt;
&lt;li&gt;And specifying the formId in the URL only works if you’re opening the form from a custom UI (that is, you can’t specify a formid when the user opens a record from a normal CRM view).&amp;#0160; &lt;/li&gt;
&lt;li&gt;Also, once a user opens a specific form CRM will remember that as the last selected form and the user will get the same form the next time they open a record, even if the formid is not provided in the URL. &lt;/li&gt;
&lt;/ol&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;br /&gt; Fortunately, there’s an easy way around these issues.&amp;#0160; It doesn’t seem to be documented in the SDK yet, but CRM saves the Id of the last form that a user viewed using the UserEntityUISettings entity, and any UserEntityUISettings record can be easily updated to set the Last Viewed form for a specific user:&lt;/p&gt;
&lt;p&gt;&amp;#0160;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt; &lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt; &lt;span style="color: green;"&gt;//retrieve the user UI settings for a specific user  		and a specified entity:&lt;/span&gt;&lt;/span&gt; &lt;br /&gt; &lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt; &lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt; &lt;span style="color: #2b91af;"&gt;QueryExpression&lt;/span&gt; query = 		&lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;QueryExpression&lt;/span&gt;(&lt;span style="color: #2b91af;"&gt;UserEntityUISettings&lt;/span&gt;.EntityLogicalName);&lt;/span&gt; &lt;br /&gt; &lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt; &lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt; query.Criteria.AddCondition(&lt;span style="color: #a31515;"&gt;&amp;quot;ownerid&amp;quot;&lt;/span&gt;, 		&lt;span style="color: #2b91af;"&gt;ConditionOperator&lt;/span&gt;.Equal, userId);&lt;/span&gt; &lt;br /&gt; &lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt; &lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt; query.Criteria.AddCondition(&lt;span style="color: #a31515;"&gt;&amp;quot;objecttypecode&amp;quot;&lt;/span&gt;, 		&lt;span style="color: #2b91af;"&gt;ConditionOperator&lt;/span&gt;.Equal,  		entityObjectTypeCode);&lt;/span&gt; &lt;br /&gt; &lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt; &lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt; &lt;span style="color: #2b91af;"&gt;EntityCollection&lt;/span&gt; UISettingsCollection =  		service.RetrieveMultiple(query);&lt;/span&gt; &lt;br /&gt; &lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt; &lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (UISettingsCollection.Entities.Count &amp;gt; 0)&lt;/span&gt; &lt;br /&gt; &lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt; &lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;{&lt;/span&gt; &lt;br /&gt; &lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt; &lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: green;"&gt;//update the last viewed formId:&lt;/span&gt;&lt;/span&gt; &lt;br /&gt; &lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt; &lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;UserEntityUISettings&lt;/span&gt; settings = (&lt;span style="color: #2b91af;"&gt;UserEntityUISettings&lt;/span&gt;)UISettingsCollection[0];&lt;/span&gt; &lt;br /&gt; &lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt; &lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;settings.LastViewedFormXml = &lt;span style="color: #a31515;"&gt;&amp;quot;&amp;lt;MRUForm&amp;gt;&amp;lt;Form  		Type=\&amp;quot;Main\&amp;quot; Id=\&amp;quot;f5cfab6a-d4c2-4519-b68f-6e7485432e29\&amp;quot; /&amp;gt;&amp;lt;/MRUForm&amp;gt;&amp;quot;&lt;/span&gt;;&lt;/span&gt; &lt;br /&gt; &lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt; &lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;service.Update(settings);&lt;/span&gt; &lt;br /&gt; &lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt; &lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The next time the user opens any record for the specified entity, they will view the form that is specified in the LastViewedFormXml.&amp;#0160; No need to specify a formId in the URL, and no need to redirect the user to a different form in JavaScript.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;#0160;~Erik Pool&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #888888;"&gt;&amp;#0160;&lt;strong&gt;&lt;em&gt;This posting is provided &amp;quot;AS IS&amp;quot; with no warranties, and confers no rights.&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;#0160;&lt;/p&gt;
&lt;p&gt;&amp;#0160;&lt;/p&gt;
&lt;p&gt;&amp;#0160;&lt;/p&gt;
&lt;div class="mcePaste" id="_mcePaste" style="position: absolute; left: -10000px; top: 688px; width: 1px; height: 1px; overflow: hidden;"&gt; 
&lt;p class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: green;"&gt;//retrieve the user UI settings for a specific user and a specified entity:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;QueryExpression&lt;/span&gt; query = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;QueryExpression&lt;/span&gt;(&lt;span style="color: #2b91af;"&gt;UserEntityUISettings&lt;/span&gt;.EntityLogicalName);&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;query.Criteria.AddCondition(&lt;span style="color: #a31515;"&gt;&amp;quot;ownerid&amp;quot;&lt;/span&gt;, &lt;span style="color: #2b91af;"&gt;ConditionOperator&lt;/span&gt;.Equal, userId);&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;query.Criteria.AddCondition(&lt;span style="color: #a31515;"&gt;&amp;quot;objecttypecode&amp;quot;&lt;/span&gt;, &lt;span style="color: #2b91af;"&gt;ConditionOperator&lt;/span&gt;.Equal, entityObjectTypeCode);&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;EntityCollection&lt;/span&gt; UISettingsCollection = service.RetrieveMultiple(query);&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (UISettingsCollection.Entities.Count &amp;gt; 0)&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: green;"&gt;//update the last viewed formId:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;UserEntityUISettings&lt;/span&gt; settings = (&lt;span style="color: #2b91af;"&gt;UserEntityUISettings&lt;/span&gt;)UISettingsCollection[0];&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;settings.LastViewedFormXml = &lt;span style="color: #a31515;"&gt;&amp;quot;&amp;lt;MRUForm&amp;gt;&amp;lt;Form Type=\&amp;quot;Main\&amp;quot; Id=\&amp;quot;f5cfab6a-d4c2-4519-b68f-6e7485432e29\&amp;quot; /&amp;gt;&amp;lt;/MRUForm&amp;gt;&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;service.Update(settings);&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;</content:encoded>


<category>CRM 2011</category>
<category>CRM Development</category>

<dc:creator>Erik Pool</dc:creator>
<pubDate>Fri, 10 Jun 2011 12:52:36 -0700</pubDate>

</item>
<item>
<title>CRM 2011 Performance Toolkit available</title>
<link>http://www.avanadeblog.com/xrm/2011/06/crm-2011-performance-toolkit-available.html</link>
<guid isPermaLink="true">http://www.avanadeblog.com/xrm/2011/06/crm-2011-performance-toolkit-available.html</guid>
<description>Noticed that the 2011 version of the Performance Testing Toolkit has been released and is available via pinpoint: http://dynamics.pinpoint.microsoft.com/en-us/applications/performance-toolkit-for-microsoft-dynamics-crm-2011-12884915630 Matt</description>
<content:encoded>&lt;p&gt;Noticed that the 2011 version of the Performance Testing Toolkit has been released and is available via pinpoint: &lt;a href="http://dynamics.pinpoint.microsoft.com/en-us/applications/performance-toolkit-for-microsoft-dynamics-crm-2011-12884915630"&gt;http://dynamics.pinpoint.microsoft.com/en-us/applications/performance-toolkit-for-microsoft-dynamics-crm-2011-12884915630&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Matt&lt;/p&gt;</content:encoded>


<category>CRM</category>
<category>CRM 2011</category>

<dc:creator>Matt Parks</dc:creator>
<pubDate>Fri, 10 Jun 2011 10:28:01 -0700</pubDate>

</item>
<item>
<title>How to: Run the Dynamics CRM 2011 Virtual Machine on VirtualBox </title>
<link>http://www.avanadeblog.com/xrm/2011/06/how-to-run-the-dynamics-crm-2011-virtual-machine-on-virtualbox-.html</link>
<guid isPermaLink="true">http://www.avanadeblog.com/xrm/2011/06/how-to-run-the-dynamics-crm-2011-virtual-machine-on-virtualbox-.html</guid>
<description>Recently Microsoft posted the latest CRM 2011 virtual machine to partner source. Information about the VM as well as where to download are available here: http://blogs.technet.com/b/dutchpts/archive/2011/05/25/microsoft-dynamics-crm-2011-virtual-machine-available-for-partners.aspx To run the VM it currently requires you to boot to VHD or to have HyperV installed. For the road warriors like me neither...</description>
<content:encoded>&lt;p&gt;Recently Microsoft posted the latest CRM 2011 virtual machine to partner source. &amp;#0160;Information about the VM as well as where to download are available here:&amp;#0160;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/b/dynpartnercommunity/archive/2011/06/06/microsoft-dynamics-crm-2011-virtual-machine-now-available.aspx"&gt;&lt;a href="http://blogs.technet.com/b/dutchpts/archive/2011/05/25/microsoft-dynamics-crm-2011-virtual-machine-available-for-partners.aspx"&gt;http://blogs.technet.com/b/dutchpts/archive/2011/05/25/microsoft-dynamics-crm-2011-virtual-machine-available-for-partners.aspx&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To run the VM it currently requires you to boot to VHD or to have HyperV installed. &amp;#0160;For the road warriors like me neither of these options are optimal. &amp;#0160;I really want to be able to fire up the image from my laptop while still having my email and host machine. &amp;#0160;So what do you do?&amp;#0160;&lt;/p&gt;
&lt;p&gt;Currently I am using VirtualBox to bridge this gap and it works quite well. &amp;#0160;VirtualBox gives me the capability to run the image, do snapshots, and still give me access to my host OS. &amp;#0160;With the latest CRM 2011 image however, it seems a lot of people (including me) are having issues booting the VM using VirtualBox. &amp;#0160;The most common behavior is the VM goes into a blue screen of death boot loop. &amp;#0160;Thankfully, this issue is easy to fix but a bit kludgy. &amp;#0160;&lt;/p&gt;
&lt;p&gt;VirtualBox by default mounts the VHD as a SATA controller. &amp;#0160;HyperV however builds its bootable VHDs on IDE controllers. &amp;#0160;Because of this, the image BSODs when attempting to launch. &amp;#0160;To remedy this problem is simple but will require you to remount the VHD as an IDE controller. &amp;#0160;Please see below for steps in how to do this.&lt;/p&gt;
&lt;p&gt;After creating your virtual machine in VirtualBox your VM&amp;#39;s settings should look like this:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.avanadeblog.com/.a/6a0120a757f751970b015432d86891970c-pi" style="display: inline;"&gt;&lt;img alt="Vbox SATA Controller" border="0" class="asset  asset-image at-xid-6a0120a757f751970b015432d86891970c image-full" src="http://www.avanadeblog.com/.a/6a0120a757f751970b015432d86891970c-800wi" title="Vbox SATA Controller" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To remount the VHD as IDE you will need to &amp;quot;Remove Attachment&amp;quot; &lt;em&gt;&lt;span style="color: #ff0000; font-size: 10pt;"&gt;(Note: Removing the attachment does not delete the VHD, it only deletes the reference to it.) &lt;/span&gt;&lt;/em&gt;&amp;#0160;&lt;/p&gt;
&lt;p&gt;After you have finished removing the SATA controller navigate to IDE Controller and select &amp;quot;Add Hard Disk&amp;quot;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.avanadeblog.com/.a/6a0120a757f751970b01538f054f9e970b-pi" style="display: inline;"&gt;&lt;img alt="VBox Add Hard Drisk" border="0" class="asset  asset-image at-xid-6a0120a757f751970b01538f054f9e970b image-full" src="http://www.avanadeblog.com/.a/6a0120a757f751970b01538f054f9e970b-800wi" title="VBox Add Hard Drisk" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Choose an existing disk and navigate to where your VHD is located. &amp;#0160;Your end result should look similar to this:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.avanadeblog.com/.a/6a0120a757f751970b014e88f87236970d-pi" style="display: inline;"&gt;&lt;img alt="VBox IDE Controller" border="0" class="asset  asset-image at-xid-6a0120a757f751970b014e88f87236970d image-full" src="http://www.avanadeblog.com/.a/6a0120a757f751970b014e88f87236970d-800wi" title="VBox IDE Controller" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When finished click &amp;quot;OK&amp;quot;.&lt;/p&gt;
&lt;p&gt;After this your VM should now fire up without the boot loop!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;This posting is provided &amp;quot;AS IS&amp;quot; with no warranties, and confers no rights.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;</content:encoded>



<dc:creator>Ross Lotharius</dc:creator>
<pubDate>Tue, 07 Jun 2011 11:47:30 -0700</pubDate>

</item>
<item>
<title>Showing custom Alerts in 2011</title>
<link>http://www.avanadeblog.com/xrm/2011/06/showing-custom-alerts-in-2011.html</link>
<guid isPermaLink="true">http://www.avanadeblog.com/xrm/2011/06/showing-custom-alerts-in-2011.html</guid>
<description>A few years back, my friend Marco posted a way to leverage CRM's in-line alert display to show a custom error message leveraging the default error window. Wondering if this approach would work on 2011, I found that the Notification area still exists in 2011 and there are some methods...</description>
<content:encoded>&lt;p&gt;A few years back, my friend &lt;a href="http://marcoamoedo.com/blog/show-custom-warning-messages-on-microsoft-dynamics-crm" target="_self"&gt;Marco&lt;/a&gt; posted a way to leverage CRM&amp;#39;s in-line alert display to show a custom error message leveraging the default error window.&amp;#0160; Wondering if this approach would work on 2011, I found that the&amp;#0160;Notification area still exists in 2011 and there are some methods exposed via the HTC file that allow for easy manipulation.&lt;/p&gt;
&lt;p&gt;The following code is, technically, unsupported and there are no guarantees that this code won&amp;#39;t change in the future, but it works.&amp;#0160;If you add the following code to a web resource and then tie the set_alert function to the onchange event of a field, you can see it operate.&amp;#0160; The second call will wipe out the displayed notifications.&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;var mep=1;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;function set_alert()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;&amp;#0160;&amp;#0160;&amp;#0160; var notificationsArea = document.getElementById(&amp;#39;crmNotifications&amp;#39;);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;&amp;#0160;&amp;#0160;&amp;#0160; if (notificationsArea == null)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;&amp;#0160;&amp;#0160;&amp;#0160; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; alert(&amp;#39;div not found&amp;#39;);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; return;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;&amp;#0160;&amp;#0160;&amp;#0160; }&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;&amp;#0160;&amp;#0160;&amp;#0160; if (mep==1)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;&amp;#0160;&amp;#0160;&amp;#0160; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; notificationsArea.AddNotification(&amp;#39;mep2&amp;#39;, 2, &amp;#39;source&amp;#39;, &amp;#39;Warning message&amp;#39;);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; notificationsArea.AddNotification(&amp;#39;mep3&amp;#39;, 3, &amp;#39;source&amp;#39;, &amp;#39;Info message&amp;#39;);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; notificationsArea.AddNotification(&amp;#39;mep1&amp;#39;, 1, &amp;#39;source&amp;#39;, &amp;#39;Critical message&amp;#39;);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; mep=2;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;&amp;#0160;&amp;#0160;&amp;#0160; }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;&amp;#0160;&amp;#0160;&amp;#0160; else&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;&amp;#0160;&amp;#0160;&amp;#0160; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; notificationsArea.SetNotifications(null, null);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; mep=1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;&amp;#0160;&amp;#0160;&amp;#0160; }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: times new roman,times; font-size: 10pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.avanadeblog.com/.a/6a0120a757f751970b014e88db0f45970d-pi" style="display: inline;"&gt;&lt;img alt="Untitled" border="0" class="asset  asset-image at-xid-6a0120a757f751970b014e88db0f45970d image-full" src="http://www.avanadeblog.com/.a/6a0120a757f751970b014e88db0f45970d-800wi" title="Untitled" /&gt;&lt;/a&gt;&amp;#0160;&lt;/p&gt;
&lt;p&gt;When you have multiple notifcation messages, they will be sorted by the severity as shown here.&lt;/p&gt;
&lt;p&gt;Matt Parks&lt;/p&gt;</content:encoded>


<category>CRM</category>
<category>CRM 2011</category>
<category>CRM Development</category>
<category>XRM</category>

<dc:creator>Matt Parks</dc:creator>
<pubDate>Thu, 02 Jun 2011 18:47:47 -0700</pubDate>

</item>
<item>
<title>Customer Care Accelerator(CCA) for 2011 Released</title>
<link>http://www.avanadeblog.com/xrm/2011/05/customer-care-acceleratorcca-for-2011-released.html</link>
<guid isPermaLink="true">http://www.avanadeblog.com/xrm/2011/05/customer-care-acceleratorcca-for-2011-released.html</guid>
<description>Happened to run across the release of the 2011 version of CCA out on the Marketplace. Finally, we can start playing with the "new and improved" version with 2011. http://dynamics-crm.pinpoint.microsoft.com/en-us/applications/customer-care-accelerator-for-microsoft-dynamics-crm-2011-12884914795 Matt Parks</description>
<content:encoded>&lt;p&gt;Happened to run across the release of the 2011 version of CCA out on the Marketplace.&amp;#0160; Finally, we can start playing with the &amp;quot;new and improved&amp;quot; version with 2011.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://dynamics-crm.pinpoint.microsoft.com/en-us/applications/customer-care-accelerator-for-microsoft-dynamics-crm-2011-12884914795"&gt;http://dynamics-crm.pinpoint.microsoft.com/en-us/applications/customer-care-accelerator-for-microsoft-dynamics-crm-2011-12884914795&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Matt Parks&lt;/p&gt;</content:encoded>


<category>CRM</category>
<category>CRM 2011</category>

<dc:creator>Matt Parks</dc:creator>
<pubDate>Wed, 04 May 2011 14:56:50 -0700</pubDate>

</item>
<item>
<title>Troubleshooting CRM "Generic Sql Error"</title>
<link>http://www.avanadeblog.com/xrm/2011/04/troubleshooting-crm-generic-sql-error.html</link>
<guid isPermaLink="true">http://www.avanadeblog.com/xrm/2011/04/troubleshooting-crm-generic-sql-error.html</guid>
<description>The Microsoft CRM web-services normally give you pretty good error messages when you make an invalid request, but occasionally you will get this error message: “Generic Sql Error”. These errors pop up enough that they’ve become a fairly common question on the CRM development forums. The usual responses are to...</description>
<content:encoded>&lt;p&gt;The Microsoft CRM web-services normally give you pretty good error messages when you make an invalid request, but occasionally you will get this error message: “&lt;strong&gt;&lt;em&gt;Generic Sql Error&lt;/em&gt;&lt;/strong&gt;”. These errors pop up enough that they’ve become a fairly &lt;a href="http://search.microsoft.com/results.aspx?q=Generic%20Sql%20Error%20meta:Search.MSForums.ForumID%2842b91635-70bd-49ab-a143-ef01bb5186d6%29%20site:microsoft.com&amp;amp;mkt=en-us" target="_blank" title="Forum search for Generic Sql Error"&gt;common question&lt;/a&gt; on the CRM development &lt;a href="http://social.microsoft.com/Forums/en-US/crmdevelopment/threads" target="_blank"&gt;forums&lt;/a&gt;. The usual responses are to either &lt;a href="http://support.microsoft.com/kb/907490" target="_blank" title="How to enable CRM Tracing"&gt;enable CRM tracing&lt;/a&gt; or use &lt;a href="http://msdn.microsoft.com/en-us/library/ms187929.aspx" target="_blank" title="MSDN: Using Sql Server Profiler"&gt;SQL Server Profiler&lt;/a&gt; to get a better error message. I find that the CRM trace logs don’t always give you anything better that the same generic error message the SDK provides, so SQL profiler is probably the better option. However, if you don’t have experience using the SQL Profiler it can be hard to find the actual error message in the vast amount of data it provides. These are the steps I take to get to the bottom of most CRM “generic SQL” errors using the SQL Profiler:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open SQL server profiler on your SQL machine. You can usually find it in the start menu under &lt;em&gt;SQL server 2008&lt;/em&gt; -&amp;gt; &lt;em&gt;Performance Tools&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;In SQL server profiler, click &lt;em&gt;File&lt;/em&gt; -&amp;gt; &lt;em&gt;Templates&lt;/em&gt; -&amp;gt; &lt;em&gt;New Template.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Select &amp;quot;Microsoft Sql Server 2008 R2&amp;quot; in the &lt;em&gt;Server Type&lt;/em&gt; dropdown.&lt;/li&gt;
&lt;li&gt;Give the Template a name in the “&lt;em&gt;New Template Name&lt;/em&gt;” field (something like “CRM Generic Sql Error”), and then click the “Event Selection” tab.&lt;/li&gt;
&lt;li&gt;On the “Event Selection” tab, check the “Show All Events” and “Show all Columns” checkboxes.&amp;#0160;&lt;/li&gt;
&lt;li&gt;In the Events table, scroll down and expand the “Errors and Warnings” section, then check the checkbox next to “&lt;em&gt;Exception&lt;/em&gt;”&amp;#0160; (this will automatically check all the other boxes on the same row).&lt;br /&gt; &lt;a href="http://www.avanadeblog.com/.a/6a0120a757f751970b014e880dd5e2970d-pi" style="display: inline;"&gt;&lt;img alt="SqlProfiler1" class="asset  asset-image at-xid-6a0120a757f751970b014e880dd5e2970d" src="http://www.avanadeblog.com/.a/6a0120a757f751970b014e880dd5e2970d-700wi" style="width: 678px;" title="SqlProfiler1" /&gt;&lt;/a&gt; &lt;br /&gt; &lt;br /&gt;&lt;/li&gt;
&lt;li&gt;In the same “Errors and Warnings” section, also check the “&lt;em&gt;User Error Message&lt;/em&gt;” checkbox. This event will give you the real SQL error message.&lt;/li&gt;
&lt;li&gt;Expand the “Stored Procedures” section and check the “&lt;em&gt;RPC Completed&lt;/em&gt;” checkbox. This event will give you the actual SQL statement that caused the SQL error (since CRM uses stored procedures for nearly everything).&lt;/li&gt;
&lt;li&gt;Next, click the “Column Filters” button, and select “DatabaseName”, and enter the name of your CRM database in the “Like” field.&amp;#0160; This will ensure that you only see CRM related data in the profiler output.&lt;br /&gt; &lt;a href="http://www.avanadeblog.com/.a/6a0120a757f751970b015431ed3f33970c-pi" style="display: inline;"&gt; &lt;/a&gt;&lt;a href="http://www.avanadeblog.com/.a/6a0120a757f751970b014e880dd6ec970d-pi" style="display: inline;"&gt;&lt;img alt="SqlProfiler2" class="asset  asset-image at-xid-6a0120a757f751970b014e880dd6ec970d" src="http://www.avanadeblog.com/.a/6a0120a757f751970b014e880dd6ec970d-350wi" style="width: 327px;" title="SqlProfiler2" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Next, save the template and then click &lt;em&gt;File &lt;/em&gt;-&amp;gt; &lt;em&gt;New Trace&lt;/em&gt;.&amp;#0160; Enter the information to connect to the SQL server when prompted and then select the template you created in the “Use The Template” field. Then click &lt;em&gt;Run&lt;/em&gt; to start tracing.&amp;#0160;&lt;/li&gt;
&lt;li&gt;Now just go do whatever it was in CRM that caused the Generic Sql Error while the trace is running. You will want to limit the amount of time the trace is running so that you have less data to sift through in the SQL profiler.&amp;#0160; Afterwards, you can click the red “Stop” button in SQL Profiler to stop tracing.&amp;#0160;&amp;#0160;&lt;/li&gt;
&lt;li&gt;Then you can search through the recorded events to find the one that caused the error. Fortunately the actual SQL errors are usually highlighted in red.&amp;#0160;&amp;#0160; &lt;br /&gt;&lt;br /&gt; &lt;a href="http://www.avanadeblog.com/.a/6a0120a757f751970b015431ed3d59970c-pi" style="display: inline;"&gt;&lt;img alt="SqlProfiler3" class="asset  asset-image at-xid-6a0120a757f751970b015431ed3d59970c" src="http://www.avanadeblog.com/.a/6a0120a757f751970b015431ed3d59970c-750wi" style="width: 706px;" title="SqlProfiler3" /&gt;&lt;/a&gt; &lt;br /&gt; &lt;br /&gt;In my case, there was a red “User Error Message” event that read &lt;em&gt;“&lt;/em&gt;&lt;span style="font-family: courier new,courier;"&gt;Cannot use a CONTAINS or FREETEXT predicate on table or indexed view ‘Account’ because it is not full-text indexed&lt;/span&gt;&lt;em&gt;”&lt;/em&gt;.&amp;#0160; And the next event listed in an &lt;em&gt;RPC:Completed&lt;/em&gt; event for the RetrieveMultiple request on the account entity that caused the error (you can see it has &lt;em&gt;&amp;quot;1 - Error&amp;quot;&lt;/em&gt; in the error column).&amp;#0160; So it turns out that I had used a “contains” operator in a query-expression condition (which isn’t supported).&amp;#0160; Switching it to a “Like” operator fixed the error. &amp;#0160;&amp;#0160;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;em&gt;&amp;#0160;~Erik Pool&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #888888;"&gt;&amp;#0160;&lt;strong&gt;&lt;em&gt;This posting is provided &amp;quot;AS IS&amp;quot; with no warranties, and confers no rights.&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;#0160;&lt;/p&gt;</content:encoded>


<category>CRM</category>
<category>CRM 2011</category>
<category>CRM Development</category>
<category>Errors</category>
<category>Troubleshooting</category>

<dc:creator>Erik Pool</dc:creator>
<pubDate>Tue, 26 Apr 2011 18:05:13 -0700</pubDate>

</item>
<item>
<title>CRM 2011 Online Go Live Checklist</title>
<link>http://www.avanadeblog.com/xrm/2011/04/crm-2011-online-go-live-checklist.html</link>
<guid isPermaLink="true">http://www.avanadeblog.com/xrm/2011/04/crm-2011-online-go-live-checklist.html</guid>
<description>Rich Choi recently posted a go live checklist for CRM 2011 Online over at the Microsoft CRM Online Team blog. This is a great checklist that contains a lot of the gotchas when deploying CRM 4 or CRM 2011 to a new environment. While the article is tailored for 2011...</description>
<content:encoded>&lt;p&gt;Rich Choi recently posted a go live checklist for CRM 2011 Online over at the &lt;a href="http://blogs.msdn.com/b/dynamicscrmonline/archive/2011/04/20/dynamics-crm-2011-go-live-checklist.aspx" target="_blank"&gt;Microsoft CRM Online Team blog&lt;/a&gt;. &amp;#0160;This is a great checklist that contains a lot of the gotchas when deploying CRM 4 or CRM 2011 to a new environment. &amp;#0160;While the article is tailored for 2011 Online, the recommendations apply to On-Premise and Partner Hosted (Private Cloud) solutions. &amp;#0160;I highly recommend reviewing these recommendations for your customers and environments.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Components-PostAttachments/00-10-15-64-36/DynamicsCRMOnline_5F00_UserBestPerformanceCheckList_5F00_April2011.pdf" target="_blank"&gt;Microsoft CRM Online - Go Live Checklist&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #888888;"&gt;&lt;strong&gt;&lt;em&gt;This posting is provided &amp;quot;AS IS&amp;quot; with no warranties, and confers no rights.&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;</content:encoded>


<category>CRM</category>
<category>CRM 2011</category>

<dc:creator>Ross Lotharius</dc:creator>
<pubDate>Thu, 21 Apr 2011 06:50:32 -0700</pubDate>

</item>
<item>
<title>CRM 2011 data caching</title>
<link>http://www.avanadeblog.com/xrm/2011/04/crm-2011-data-caching.html</link>
<guid isPermaLink="true">http://www.avanadeblog.com/xrm/2011/04/crm-2011-data-caching.html</guid>
<description>For many CRM 2011 applications, caching of commonly retrieved data is important for maintaining a high performance system. Typically, you want to cache any data that is retrieved frequently but does not change often. In a CRM system this is usually either configuration data or CRM entity metadata. In CRM...</description>
<content:encoded>&lt;p&gt;For many CRM 2011 applications, caching of commonly retrieved data is important for maintaining a high performance system. Typically, you want to cache any data that is retrieved frequently but does not change often. In a CRM system this is usually either configuration data or CRM entity metadata.&lt;/p&gt;
&lt;p&gt;In CRM 4.0, the way you typically extended a CRM application was by creating another ASP.NET web-app that connected to CRM through the CRM web-services, and it was fairly simple to cache common data on the server using the asp.net HttpRuntime cache.&amp;#0160; For CRM 2011, the landscape has changed a bit, mostly due to the introduction of web-resources and the more frequent use of CRM Online as a hosting option.&amp;#0160; Now, the recommended best-practice is to not extend CRM using a separate ASP.NET application (if possible), but to create all of your custom UI elements using Silverlight or JavaScript web-resources, and handle all of your server-side business logic in CRM plug-ins.&amp;#0160; Here&amp;#39;s a couple of things to keep in mind when using this new model:&amp;#0160; &lt;strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You can get free client-side caching if your data is stored as a web-resource.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;XML web-resources are an ideal way to store configuration info on the CRM server.&amp;#0160; When the xml file is retrieved by your client-side Silverlight or JavaScript UI components, the browser will automatically cache the retrieved file for you.&amp;#0160; This works great for most configuration info, but not for any sensitive data.&amp;#0160; All web-resources can be viewed by any user with access to CRM, and there’s no way to lock down specific resources by role.&amp;#0160; So anything sensitive such as connection strings or passwords will still need to be stored in a custom entity (which can be locked down by role).&amp;#0160; Also, CRM 2011 is designed to effectively clear any browser-cached web-resources whenever they are modified and re-published.&amp;#0160; Which leads to.. &lt;strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Always reference web-resources using relative URLs or the $webresource syntax.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you reference a CRM web-resource using its full URL (for example:&amp;#0160; http://CRMServer/Org/WebResources/new_/MyWebResource.htm) you&amp;#39;re browser won&amp;#39;t actually cache the file. When CRM serves the file the cache-control header on the response will be set to expire immediately, and so All requests using the full URL will always retrieve the file from the server. To get browser-caching you need to reference the file using a special relative URL, which looks like this:&amp;#0160;&lt;/p&gt;
&lt;p&gt;http://CrmServer/Org/&lt;span style="color: #ff0000;"&gt;%7B634380644480000000%7D&lt;/span&gt;/WebResources/new_/UI/ClientBin/MyWebResource.htm&lt;/p&gt;
&lt;p&gt;Notice the magic number inserted into the URL?&amp;#0160; When CRM serves files from URLs in this format the cache-control header on the response will be set to expire in one year, so the browser will cache the file properly.&amp;#0160; CRM will also automatically change the unique number whenever web-resources are modified and published, causing the browser to retrieve the new version of the file.&amp;#0160;&lt;/p&gt;
&lt;p&gt;If you add a web-resource to a CRM form using the “Add Web Resource” button, then CRM will automatically use the special URL for you. But If you are referencing a web-resource in a ribbon or in the sitemap XML then you need to make sure you always use the $webresource:MyWebResourceName syntax.&amp;#0160; This ensures that caching is enabled on the web-resource file.&amp;#0160; And if you are referencing web-resources from other web-resources (e.g., retrieving a config xml file from a Silverlight app), you should always use relative paths so that the URL contains the unique number.&amp;#0160;  &lt;strong&gt;&amp;#0160;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;br /&gt;Server-side caching is not available for sandboxed plug-ins.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;CRM Online only lets you run plug-ins in the “sandboxed” isolation mode.&amp;#0160; This pretty much restricts your ability to use any kind of server-side caching.&amp;#0160; Using the ASP.Net http-runtime cache is not allowed, and you cannot even cache data in static variables because the sandboxing system effectively hosts the plug-in in a new process each time the plug-in is fired.&amp;#0160; You can, however, achieve a very limited sort of caching using plug-in &lt;a href="http://msdn.microsoft.com/en-us/library/gg328579.aspx" target="_self"&gt;shared variables&lt;/a&gt;. This data can only be shared across different plug-ins in the same execution pipeline, but it can be useful in some situations.&amp;#0160; For example: if you had multiple plug-ins on the same message that each require retrieving the same metadata, you can temporarily cache the metadata in the shared variables collection. &lt;strong&gt;&amp;#0160;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;br /&gt;Clearing server-side caches on load-balanced systems.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;#0160;&lt;/strong&gt;For an on-premise CRM deployment you don’t need to run plug-ins in sandbox mode, so you &lt;em&gt;can &lt;/em&gt;take advantage of server-side caching.&amp;#0160; However, for systems that are load-balanced and have multiple platform and application web-servers, it can be tricky to make sure that the cached data on each system is properly synchronized.&amp;#0160; To outline the problem, suppose you have a CRM system that stores data in a custom entity, and several CRM plug-ins that use this data. To reduce the number of database retrieves, the plug-ins cache the data using the ASP.NET cache. Also, you have three load-balanced application servers. Each server has its own in-memory cache, so when the configuration information changes, you need to clear the cache on all three servers.&lt;/p&gt;
&lt;p&gt;One way to handle this is to piggy-back off of the internal messaging system that CRM uses whenever the configuration string for a plug-in is updated. Whenever you register a CRM plug-in you are given the option to define a config string that is then passed to the constructor of the plugin when it is instantiated. &amp;#0160;If the configuration string is updated (from any server), the new string will be passed to the constructor of the plug-in on all servers.&amp;#0160; So if we want to clear the cache on all servers at once, we can just change the config string to a new unique value:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style="color: #2b91af; font-family: Consolas;"&gt;QueryExpression&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt; findPluginStep = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;QueryExpression&lt;/span&gt;(&lt;span style="color: #2b91af;"&gt;SdkMessageProcessingStep&lt;/span&gt;.EntityLogicalName);&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;br /&gt;findPluginStep.Criteria.AddCondition(&lt;span style="color: #a31515;"&gt;&amp;quot;name&amp;quot;&lt;/span&gt;, &lt;span style="color: #2b91af;"&gt;ConditionOperator&lt;/span&gt;.Equal, &lt;span style="color: #a31515;"&gt;&amp;quot;MyPluginStepName&amp;quot;&lt;/span&gt;);&lt;/span&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;br /&gt;foreach&lt;/span&gt; (&lt;span style="color: #2b91af;"&gt;SdkMessageProcessingStep&lt;/span&gt; step &lt;span style="color: blue;"&gt;in&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt; service.RetrieveMultiple(findPluginStep).Entities)&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;br /&gt;{&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="color: green;"&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;//give the plugin step a new unique config string (the current datetime)&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;step.Configuration = &lt;span style="color: #2b91af;"&gt;DateTime&lt;/span&gt;.Now.ToString();&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;br /&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;service.Update(step);&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Then, in the plugin’s constructor, if the configuration string changes, you know it’s time to clear your cache:&lt;/p&gt;
&lt;blockquote&gt;
&lt;div class="MsoNormal"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;private&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; _oldConfig = &lt;span style="color: blue;"&gt;null&lt;/span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 8pt;"&gt; &amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;&lt;span style="color: green; font-family: Consolas; font-size: 8pt;"&gt; //constructor&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;&lt;span style="font-size: 8pt;"&gt; &lt;span style="color: blue; font-family: Consolas;"&gt;public&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt; MyPlugin(&lt;span style="color: blue;"&gt;string&lt;/span&gt; config)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 8pt;"&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="font-size: 8pt;"&gt; &lt;span style="color: blue; font-family: Consolas;"&gt;if&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt; (_oldConfig != config)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 8pt;"&gt; &amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; {&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 8pt;"&gt; &amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;span style="color: #2b91af;"&gt;HttpRuntime&lt;/span&gt;.Cache.Remove(CACHE_KEY);&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-left: 0.5in; text-indent: 0.5in;"&gt;&lt;span style="font-family: Consolas; font-size: 8pt;"&gt; _oldConfig = config;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style="font-family: Consolas; font-size: 8pt;"&gt; }&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 8pt;"&gt; }&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is an easy way to synchronize cached data across multiple servers, as CRM does the messaging for you without any extra overhead.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="color: #111111;"&gt;&lt;em&gt;~ Erik Pool&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="color: #111111;"&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #737373;"&gt;&lt;strong&gt;This posting is provided &amp;quot;AS IS&amp;quot; with no warranties, and confers no rights.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div class="mcePaste" id="_mcePaste" style="position: absolute; left: -10000px; top: 2241px; width: 1px; height: 1px; overflow: hidden;"&gt;
&lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: 0.5in;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af;"&gt;QueryExpression&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt; findPluginStep = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;QueryExpression&lt;/span&gt;(&lt;span style="color: #2b91af;"&gt;SdkMessageProcessingStep&lt;/span&gt;.EntityLogicalName);&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;findPluginStep.Criteria.AddCondition(&lt;span style="color: #a31515;"&gt;&amp;quot;name&amp;quot;&lt;/span&gt;, &lt;span style="color: #2b91af;"&gt;ConditionOperator&lt;/span&gt;.Equal, &lt;span style="color: #a31515;"&gt;&amp;quot;MyPluginStepName&amp;quot;&lt;/span&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color: #2b91af;"&gt;SdkMessageProcessingStep&lt;/span&gt; step &lt;span style="color: blue;"&gt;in&lt;/span&gt; service.RetrieveMultiple(findPluginStep).Entities)&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;&lt;span style="color: green;"&gt;//give the plugin step a new unique config string (the current datetime)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;step.Configuration = &lt;span style="color: #2b91af;"&gt;DateTime&lt;/span&gt;.Now.ToString();&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;service.Update(step);&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;span&gt;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160;&amp;#0160; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;</content:encoded>


<category>CRM 2011</category>
<category>CRM Development</category>

<dc:creator>Erik Pool</dc:creator>
<pubDate>Wed, 20 Apr 2011 21:19:38 -0700</pubDate>

</item>
<item>
<title>CRM 2011 RTM On-Premise Patch now available!  (Build 9688.583)</title>
<link>http://www.avanadeblog.com/xrm/2011/02/crm-2011-rtm-on-premise-patch-now-available-build-9688583.html</link>
<guid isPermaLink="true">http://www.avanadeblog.com/xrm/2011/02/crm-2011-rtm-on-premise-patch-now-available-build-9688583.html</guid>
<description>A patch is now available to upgrade deployments of CRM 2011 RC1 to the RTM build. The process is amazingly easy, no harder than applying a CRM 4.0 Rollup Update! The new build is 5.0.9688.583 (two builds below CRM Online) If you have signed up for Microsoft Updates this should...</description>
<content:encoded>&lt;p&gt;A patch is now available to upgrade deployments of CRM 2011 RC1 to the RTM build.&amp;#0160; The process is &lt;em&gt;&lt;span style="color: #ff0000;"&gt;amazingly easy&lt;/span&gt;&lt;/em&gt;, no harder than applying a CRM 4.0 Rollup Update!&lt;/p&gt;
&lt;p&gt;The new build is 5.0.9688.583 (two builds below CRM Online)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.avanadeblog.com/.a/6a0120a757f751970b014e864fa0cb970d-pi" style="display: inline;"&gt;&lt;img alt="About" class="asset  asset-image at-xid-6a0120a757f751970b014e864fa0cb970d" src="http://www.avanadeblog.com/.a/6a0120a757f751970b014e864fa0cb970d-320wi" title="About" /&gt;&lt;/a&gt; &lt;br /&gt;&amp;#0160;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;If you have signed up for Microsoft Updates this should be applied automatically.&amp;#0160; If not you can manually download it here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://catalog.update.microsoft.com/v7/site/Search.aspx?q=crm" target="_self"&gt;http://catalog.update.microsoft.com/v7/site/Search.aspx?q=crm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.avanadeblog.com/.a/6a0120a757f751970b014e864fa075970d-pi" style="display: inline;"&gt;&lt;img alt="Update_RC" border="0" class="asset  asset-image at-xid-6a0120a757f751970b014e864fa075970d image-full" src="http://www.avanadeblog.com/.a/6a0120a757f751970b014e864fa075970d-800wi" title="Update_RC" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;You can read more about this update process &lt;a href="http://www.avanadeblog.com/xrm/2010/10/crm-2011-beta-update-and-build-numbers.html" target="_self"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&amp;#0160;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;This posting is provided &amp;quot;AS IS&amp;quot; with no warranties, and confers no rights.&lt;/strong&gt;&lt;/p&gt;</content:encoded>


<category>CRM 2011</category>

<dc:creator>Aaron E.</dc:creator>
<pubDate>Fri, 25 Feb 2011 07:34:56 -0800</pubDate>

</item>

</channel>
</rss><!-- ph=1 -->

