<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Trace.WriteLine(_blogTitle); &#187; Hints</title> <atom:link href="http://www.langalaxy.de/tag/hints/feed/" rel="self" type="application/rss+xml" /><link>http://www.langalaxy.de</link> <description>Random output</description> <lastBuildDate>Fri, 28 Oct 2011 17:20:03 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Using HttpUtility.UrlEncode in a plugin leads to a SecurityException</title><link>http://www.langalaxy.de/2011/05/using-httputility-urlencode-in-a-plugin-leads-to-a-securityexception/</link> <comments>http://www.langalaxy.de/2011/05/using-httputility-urlencode-in-a-plugin-leads-to-a-securityexception/#comments</comments> <pubDate>Wed, 18 May 2011 21:28:18 +0000</pubDate> <dc:creator>ckeller</dc:creator> <category><![CDATA[Dynamics CRM]]></category> <category><![CDATA[.NET-4]]></category> <category><![CDATA[CRM 2011]]></category> <category><![CDATA[en]]></category> <category><![CDATA[Hints]]></category> <category><![CDATA[Plugins]]></category><guid
isPermaLink="false">http://www.langalaxy.de/?p=530</guid> <description><![CDATA[In a recent project I had to develop a plugin which is executed in the plugin sandbox. The sandbox restricts the rights plugins to a &#8216;safe&#8217; amount. See http://msdn.microsoft.com/en-us/library/gg334752.aspx for a description. According to the SDK, web request are allowed. Part of my task was to send a request to a web service which expects [...]]]></description> <content:encoded><![CDATA[<p>In a recent project I had to develop a plugin which is executed in the plugin sandbox. The sandbox restricts the rights plugins to a &#8216;safe&#8217; amount. See <a
href="http://msdn.microsoft.com/en-us/library/gg334752.aspx">http://msdn.microsoft.com/en-us/library/gg334752.aspx</a> for a description. According to the SDK, web request are allowed.</p><p>Part of my task was to send a request to a web service which expects data URL-encoded. Normally you would use following class (part of <code>System.Web</code>)</p><div
class="wp_syntax"><div
class="code"><pre class="csharp" style="font-family:monospace;">HttpUtility<span style="color: #008000;">.</span><span style="color: #0000FF;">UrlEncode</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;some data here&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div><p>I was surprised that this leads to a <code>SecurityException</code> if used in a sand-boxed plugin. The sandbox does not allow the use of this class.</p><p>Instead of rewriting the method (I hate reinventing the wheel&#8230;) I&#8217;ve searched for a replacement, and found</p><div
class="wp_syntax"><div
class="code"><pre class="csharp" style="font-family:monospace;">Uri<span style="color: #008000;">.</span><span style="color: #0000FF;">EscapeDataString</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;some data here&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div><p>which is usable in sand-boxed plugins. For my task the result was the same as with <code>UrlEncode</code>, however I am not sure I they are different in their results.</p> ]]></content:encoded> <wfw:commentRss>http://www.langalaxy.de/2011/05/using-httputility-urlencode-in-a-plugin-leads-to-a-securityexception/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Do I need that SPN?</title><link>http://www.langalaxy.de/2011/03/do-i-need-that-spn/</link> <comments>http://www.langalaxy.de/2011/03/do-i-need-that-spn/#comments</comments> <pubDate>Thu, 03 Mar 2011 19:22:07 +0000</pubDate> <dc:creator>ckeller</dc:creator> <category><![CDATA[Dynamics CRM]]></category> <category><![CDATA[CRM 2011]]></category> <category><![CDATA[CRM 4]]></category> <category><![CDATA[en]]></category> <category><![CDATA[Hints]]></category><guid
isPermaLink="false">http://www.langalaxy.de/?p=522</guid> <description><![CDATA[One important thing that is often forgotten during/after the installation of Dynamics CRM is to properly set the SPNs for your service accounts (if necessary ). Here are three links which I often take as reference when we plan new deployments: http://blogs.msdn.com/b/webtopics/archive/2009/01/19/service-principal-name-spn-checklist-for-kerberos-authentication-with-iis-7-0.aspx http://rc.crm.dynamics.com/rc/regcont/en_us/op/articles/configurespn.aspx#o45872 http://blog.sonomapartners.com/2007/04/kerberos_and_de.html]]></description> <content:encoded><![CDATA[<p>One important thing that is often forgotten during/after the installation of Dynamics CRM is to properly set the SPNs for your service accounts (if necessary <img
src='http://www.langalaxy.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ).<br
/> Here are three links which I often take as reference when we plan new deployments:</p><ul><li><a
href="http://blogs.msdn.com/b/webtopics/archive/2009/01/19/service-principal-name-spn-checklist-for-kerberos-authentication-with-iis-7-0.aspx">http://blogs.msdn.com/b/webtopics/archive/2009/01/19/service-principal-name-spn-checklist-for-kerberos-authentication-with-iis-7-0.aspx</a></li><li><a
href="http://rc.crm.dynamics.com/rc/regcont/en_us/op/articles/configurespn.aspx#o45872">http://rc.crm.dynamics.com/rc/regcont/en_us/op/articles/configurespn.aspx#o45872</a></li><li><a
href="http://blog.sonomapartners.com/2007/04/kerberos_and_de.html">http://blog.sonomapartners.com/2007/04/kerberos_and_de.html</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://www.langalaxy.de/2011/03/do-i-need-that-spn/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>MissingMethodException at E-Mail-Router installation</title><link>http://www.langalaxy.de/2010/10/missingmethodexception-at-e-mail-router-installation/</link> <comments>http://www.langalaxy.de/2010/10/missingmethodexception-at-e-mail-router-installation/#comments</comments> <pubDate>Wed, 06 Oct 2010 18:38:05 +0000</pubDate> <dc:creator>ckeller</dc:creator> <category><![CDATA[Dynamics CRM]]></category> <category><![CDATA[CRM 4]]></category> <category><![CDATA[Hints]]></category><guid
isPermaLink="false">http://www.langalaxy.de/?p=485</guid> <description><![CDATA[This week I&#8217;ve installed the E-Mail-Router for a customer. During the setup an error came up Action Microsoft.Crm.Setup.Exchange.GenerateEncryptionKeyAction failed. Method not found: &#8216;Boolean Microsoft.Crm.ApplicationConfig.IsFederalInformationProcessingCompliant()&#8217;. The cause of this error was a pending restart which was requested by Windows Update. I have no clue if a specific update was the cause of the problem, or the [...]]]></description> <content:encoded><![CDATA[<p>This week I&#8217;ve installed the E-Mail-Router for a customer. During the setup an error came up</p><blockquote><p>Action Microsoft.Crm.Setup.Exchange.GenerateEncryptionKeyAction failed.</p><p>Method not found: &#8216;Boolean Microsoft.Crm.ApplicationConfig.IsFederalInformationProcessingCompliant()&#8217;.</p></blockquote><p>The cause of this error was a pending restart which was requested by Windows Update. I have no clue if a specific update was the cause of the problem, or the system state itself.<br
/> However, after rebooting the machine, the error went away and the setup was successful.</p><p>So keep in mind, if the pre-checks warns you about a pending reboot, it is sometimes better not to ignore this hint <img
src='http://www.langalaxy.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://www.langalaxy.de/2010/10/missingmethodexception-at-e-mail-router-installation/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Why OptimizeOrgImport is not always an optimization</title><link>http://www.langalaxy.de/2010/07/why-optimizeorgimport-is-not-always-an-optimization/</link> <comments>http://www.langalaxy.de/2010/07/why-optimizeorgimport-is-not-always-an-optimization/#comments</comments> <pubDate>Mon, 12 Jul 2010 20:18:17 +0000</pubDate> <dc:creator>ckeller</dc:creator> <category><![CDATA[Dynamics CRM]]></category> <category><![CDATA[CRM 4]]></category> <category><![CDATA[Hints]]></category> <category><![CDATA[Import]]></category> <category><![CDATA[Tracing]]></category><guid
isPermaLink="false">http://www.langalaxy.de/?p=447</guid> <description><![CDATA[Update Rollup 8 introduced an improved organization import process which speeds up the organization import. You have to enable the optimized import process by adding the DWORD key OptimizeOrgImport with value 1 to the registry hive of Dynamics CRM (see the detailed description http://support.microsoft.com/kb/977867) Recently, I had a problem during an import of an organization [...]]]></description> <content:encoded><![CDATA[<p>Update Rollup 8 introduced an improved organization import process which speeds up the organization import.</p><p>You have to enable the optimized import process by adding the <em>DWORD</em> key <em>OptimizeOrgImport</em> with value <em>1</em> to the registry hive of Dynamics CRM (see the detailed description <a
href="http://support.microsoft.com/kb/977867/">http://support.microsoft.com/kb/977867</a>)</p><p>Recently, I had a problem during an import of an organization which failed with following error</p><blockquote><p>Message: Exception during import of organization (Name=&#8217;<em><orgname></orgname></em>&#8216;, Id=3e58a0cc-c277-df11-b2c1-0050569473db):<br
/> System.Data.SqlClient.SqlException: A row with a duplicate key cannot be added to the object ‘dbo.SystemUserOrganizations’-object with unique index ‘SystemUserOrganizations_CrmUserId’</p></blockquote><p>The organization which I tried to import was a backup of an organization which was created in the same deployment. The import runs successful on every other deployment. With help of the Microsoft Support, we identified the cause of the issue: the OptimizeOrgImport key.</p><p>The knowledgebase article for <em><a
href="http://support.microsoft.com/kb/977867">OptimizeOrgImport</a></em> contains following passage:</p><blockquote><p>When you use the registry entry OptimizeOrgImport and have the value of this entry set to 1, you cannot import the same organization database more than one time.<br
/> If you want to import the same organization database more than one time, you must do one of the following things:</p><ul><li>Set OptimizeOrgImport = 0 and use the normal import process.</li><li>Delete the organization, and then import the organization again.</li></ul></blockquote><p>This passage is a little bit misleading, as the optimized import process fails already at the first time, if the organization was created in the same deployment. In order to import a backup of an organization into the originating deployment, you have to deactivate <em>OptimizeOrgImport</em>.</p> ]]></content:encoded> <wfw:commentRss>http://www.langalaxy.de/2010/07/why-optimizeorgimport-is-not-always-an-optimization/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>0&#215;80044195 The specified language code is not valid for this organization</title><link>http://www.langalaxy.de/2009/12/0x80044195-the-specified-language-code-is-not-valid-for-this-organization/</link> <comments>http://www.langalaxy.de/2009/12/0x80044195-the-specified-language-code-is-not-valid-for-this-organization/#comments</comments> <pubDate>Sun, 13 Dec 2009 15:36:47 +0000</pubDate> <dc:creator>ckeller</dc:creator> <category><![CDATA[Dynamics CRM]]></category> <category><![CDATA[Hints]]></category> <category><![CDATA[Redeployment]]></category> <category><![CDATA[Support]]></category><guid
isPermaLink="false">http://www.langalaxy.de/?p=300</guid> <description><![CDATA[Recently I had a problem with a dev system at a customer site. The system was redeployed from the production site without any problems. Everything worked well, until I tried to customize the system. As soon as I tried to create new attributes or new relationships, the system produced an error The language code 1033 [...]]]></description> <content:encoded><![CDATA[<p>Recently I had a problem with a dev system at a customer site. The system was redeployed from the production site without any problems. Everything worked well, until I tried to customize the system. As soon as I tried to create new attributes or new relationships, the system produced an error</p><blockquote><p>The language code 1033 is not a valid language for this organization</p></blockquote><p>I searched the net, but the only things I found was that this error is listed as an error code of Dynamics CRM (see <a
href="http://msdn.microsoft.com/en-us/library/bb930493(loband).aspx">http://msdn.microsoft.com/en-us/library/bb930493(loband).aspx</a>) and a thread in the Dynamics Forums (<a
href="http://social.microsoft.com/Forums/en/crm/thread/70bbbf36-1ecb-443e-852a-bebaa70c7206">http://social.microsoft.com/Forums/en/crm/thread/70bbbf36-1ecb-443e-852a-bebaa70c7206</a>), but sadly without a solution.</p><p>After contacting the Dynamics CRM support team, the cause of this error was found in a matter of minutes. The system was redeployed from an installation with German base language to a system with English base language. This is an <strong>unsupported</strong> scenario.</p><p>Neither there was a warning at the redeployment wizard, nor is this mentioned in the Implementation Guide (at least, I haven&#8217;t found it there). The support engineer provided me following excerpt there this scenario is described as unsupported</p><blockquote><p>The original deployment and the new deployment of Microsoft Dynamics CRM must be the same base language.<br
/> <br
/> <em><strong>NOTE:</strong> Redeployment between different base languages, for example from English to French, is not supported.</em></p></blockquote><p>To bad that this snippet is only included in the course material for the Installation and Deployment exam and not in the Implementation Guide. The only solution was to do a full reinstall of Dynamics CRM with the same base language as the originating system and to do the reployment again.</p><p><strong>Update</strong><br
/> In the meantime I got new feedback from the support engineer (thank you José) who is responsible for my case. Microsoft will document this scenario either with a knowledgebase article or by adding the quoted note to the Implementation Guide.</p> ]]></content:encoded> <wfw:commentRss>http://www.langalaxy.de/2009/12/0x80044195-the-specified-language-code-is-not-valid-for-this-organization/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>System.InvalidOperationException at crm logon</title><link>http://www.langalaxy.de/2009/11/system-invalidoperationexception-at-crm-logon/</link> <comments>http://www.langalaxy.de/2009/11/system-invalidoperationexception-at-crm-logon/#comments</comments> <pubDate>Tue, 17 Nov 2009 17:58:56 +0000</pubDate> <dc:creator>ckeller</dc:creator> <category><![CDATA[Dynamics CRM]]></category> <category><![CDATA[CRM 4]]></category> <category><![CDATA[Debugging]]></category> <category><![CDATA[Hints]]></category> <category><![CDATA[SQL]]></category> <category><![CDATA[Support]]></category><guid
isPermaLink="false">http://www.langalaxy.de/?p=283</guid> <description><![CDATA[Today I had a service call with Microsoft CRM Support. After the import of an organization into a development system at a client, it stopped working. Trying to logon CRM via web client fails with error message: System.InvalidOperationException: ExecuteNonQuery requires the command to have a transaction when the connection assigned to the command is in [...]]]></description> <content:encoded><![CDATA[<p>Today I had a service call with Microsoft CRM Support. After the import of an organization into a development system at a client, it stopped working. Trying to logon CRM via web client fails with error message:</p><blockquote><p>System.InvalidOperationException: ExecuteNonQuery requires the command to have a transaction when the connection assigned to the command is in a pending local transaction.  The Transaction property of the command has not been initialized.</p></blockquote><p>The solution of this problem was quite simple (after the reason was found). The application pool of the system had insufficient rights for the organization database.</p><p>To get the system up and running again you have to</p><ol><li>Identify the identity of the application pool</li><li>Ensure the app pool idenity has a sql user assigned for the organization database</li><li>Grant the app pool identity the right db_owner on the organization database</li><li>Restart IIS</li></ol> ]]></content:encoded> <wfw:commentRss>http://www.langalaxy.de/2009/11/system-invalidoperationexception-at-crm-logon/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Who triggered my plugin?</title><link>http://www.langalaxy.de/2009/09/who-triggered-my-plugin/</link> <comments>http://www.langalaxy.de/2009/09/who-triggered-my-plugin/#comments</comments> <pubDate>Sat, 12 Sep 2009 18:40:58 +0000</pubDate> <dc:creator>ckeller</dc:creator> <category><![CDATA[Dynamics CRM]]></category> <category><![CDATA[CRM 4]]></category> <category><![CDATA[Hints]]></category> <category><![CDATA[Plugins]]></category> <category><![CDATA[SDK]]></category><guid
isPermaLink="false">http://www.langalaxy.de/?p=256</guid> <description><![CDATA[Do you ever want to know who triggered the execution of a plugin? This knowledge is handy, if you have to do some operation if the user entered data, but not if an external application made an update with the SDK. The IPluginExecutionContext contains the property CallerOrigin which will tell us more about the origin [...]]]></description> <content:encoded><![CDATA[<p>Do you ever want to know who triggered the execution of a plugin? This knowledge is handy, if you have to do some operation if the user entered data, but not if an external application made an update with the SDK.</p><p>The <em>IPluginExecutionContext</em> contains the property <a
href="http://msdn.microsoft.com/en-us/library/cc156395.aspx">CallerOrigin</a> which will tell us more about the origin which triggered the plugin execution.</p><p>The CallerOrigin is populated with one of these four types</p><ul><li><a
href="http://msdn.microsoft.com/en-us/library/cc156328.aspx">Application</a> &#8211; The user has triggered the event (by creating or editing a record).</li><li><a
href="http://msdn.microsoft.com/en-us/library/cc156329.aspx">AsyncService</a> &#8211; The async service triggered the event (by workflow execution).</li><li><a
href="http://msdn.microsoft.com/en-us/library/cc156336.aspx">WebServiceApi</a> &#8211; An application which makes use of the crm web service triggered the event.</li><li><a
href="http://msdn.microsoft.com/en-us/library/cc153425.aspx">OfflineOrigin</a> &#8211; The event was triggered by replaying offline actions while going online.</li></ul><p>This sample shows how to make use of this property (the sample is part of the sdk article <a
href="http://msdn.microsoft.com/en-us/library/cc151093.aspx">Online vs. Offline Plug-ins</a>)</p><div
class="wp_syntax"><div
class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">Microsoft.Crm.Sdk</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">Microsoft.Crm.SdkTypeProxy</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> OnlinePlugin <span style="color: #008000;">:</span> IPlugin
<span style="color: #008000;">&#123;</span>
   <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> Execute<span style="color: #008000;">&#40;</span>IPluginExecutionContext context<span style="color: #008000;">&#41;</span>
   <span style="color: #008000;">&#123;</span>
      <span style="color: #008080; font-style: italic;">// Check to see if this is a playback context.</span>
      CallerOrigin callerOrigin <span style="color: #008000;">=</span> context<span style="color: #008000;">.</span><span style="color: #0000FF;">CallerOrigin</span><span style="color: #008000;">;</span>
&nbsp;
      <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>callerOrigin <span style="color: #008000;">is</span> OfflineOrigin<span style="color: #008000;">&#41;</span>
      <span style="color: #008000;">&#123;</span>
         <span style="color: #008080; font-style: italic;">// This plug-in was fired from the playback queue after the user</span>
         <span style="color: #008080; font-style: italic;">// selected to go online within Microsoft Dynamics CRM for Outlook.</span>
         <span style="color: #0600FF; font-weight: bold;">return</span><span style="color: #008000;">;</span>
      <span style="color: #008000;">&#125;</span>
      <span style="color: #0600FF; font-weight: bold;">else</span>
      <span style="color: #008000;">&#123;</span>
         <span style="color: #008080; font-style: italic;">// Do something here.</span>
      <span style="color: #008000;">&#125;</span>
   <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>]]></content:encoded> <wfw:commentRss>http://www.langalaxy.de/2009/09/who-triggered-my-plugin/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Error 0x80044a08: &#8216;invalid character in file name&#8217;</title><link>http://www.langalaxy.de/2009/08/error-0x80044a08-invalid-character-in-file-name/</link> <comments>http://www.langalaxy.de/2009/08/error-0x80044a08-invalid-character-in-file-name/#comments</comments> <pubDate>Tue, 25 Aug 2009 17:43:07 +0000</pubDate> <dc:creator>ckeller</dc:creator> <category><![CDATA[Dynamics CRM]]></category> <category><![CDATA[CRM 4]]></category> <category><![CDATA[Hints]]></category> <category><![CDATA[SDK]]></category><guid
isPermaLink="false">http://www.langalaxy.de/?p=216</guid> <description><![CDATA[If you try to upload a file to a note in your crm system, you have to make sure that the property filename of the annotation only contains the filename. If it contains for example the drive letters you will receive the error 0x80044a08. The easiest way to ensure that the filename contains only the [...]]]></description> <content:encoded><![CDATA[<p>If you try to upload a file to a note in your crm system, you have to make sure that the property <a
href="http://msdn.microsoft.com/en-us/library/cc151511.aspx">filename</a> of the annotation only contains the filename. If it contains for example the drive letters you will receive the error 0x80044a08.</p><p>The easiest way to ensure that the filename contains only the file name is to use Path.GetFileName( &#8230; );</p><p>See the &#8216;corrected&#8217; sdk example below</p><div
class="wp_syntax"><div
class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">// Open a file and read the contents into a byte array.</span>
FileStream stream <span style="color: #008000;">=</span> File<span style="color: #008000;">.</span><span style="color: #0000FF;">OpenRead</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;some-path-pointing-to-a-file-in-here&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #6666cc; font-weight: bold;">byte</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> byteData <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> <span style="color: #6666cc; font-weight: bold;">byte</span><span style="color: #008000;">&#91;</span>stream<span style="color: #008000;">.</span><span style="color: #0000FF;">Length</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">;</span>
stream<span style="color: #008000;">.</span><span style="color: #0000FF;">Read</span><span style="color: #008000;">&#40;</span>byteData, <span style="color: #FF0000;">0</span>, byteData<span style="color: #008000;">.</span><span style="color: #0000FF;">Length</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
stream<span style="color: #008000;">.</span><span style="color: #0000FF;">Close</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">// Encode the data using base64.</span>
<span style="color: #6666cc; font-weight: bold;">string</span> encodedData <span style="color: #008000;">=</span> <span style="color: #000000;">System</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Convert</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToBase64String</span><span style="color: #008000;">&#40;</span>byteData<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">// Now update the note.</span>
annotation updateNote <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> annotation<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
updateNote<span style="color: #008000;">.</span><span style="color: #0000FF;">annotationid</span> <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Key<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
updateNote<span style="color: #008000;">.</span><span style="color: #0000FF;">annotationid</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span> <span style="color: #008000;">=</span> createdNoteId<span style="color: #008000;">;</span>
updateNote<span style="color: #008000;">.</span><span style="color: #0000FF;">documentbody</span> <span style="color: #008000;">=</span> encodedData<span style="color: #008000;">;</span>
updateNote<span style="color: #008000;">.</span><span style="color: #0000FF;">filename</span> <span style="color: #008000;">=</span> Path<span style="color: #008000;">.</span><span style="color: #0000FF;">GetFileName</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;some-path-pointing-to-a-file-in-here&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
updateNote<span style="color: #008000;">.</span><span style="color: #0000FF;">mimetype</span> <span style="color: #008000;">=</span> <span style="color: #666666;">@&quot;application\ms-word&quot;</span><span style="color: #008000;">;</span>
&nbsp;
service<span style="color: #008000;">.</span><span style="color: #0000FF;">Update</span><span style="color: #008000;">&#40;</span>updateNote<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>]]></content:encoded> <wfw:commentRss>http://www.langalaxy.de/2009/08/error-0x80044a08-invalid-character-in-file-name/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Howto: Retrieve members of a marketing list</title><link>http://www.langalaxy.de/2009/07/howto-retrieve-members-of-a-marketing-list/</link> <comments>http://www.langalaxy.de/2009/07/howto-retrieve-members-of-a-marketing-list/#comments</comments> <pubDate>Thu, 16 Jul 2009 16:43:35 +0000</pubDate> <dc:creator>ckeller</dc:creator> <category><![CDATA[Dynamics CRM]]></category> <category><![CDATA[CRM 4]]></category> <category><![CDATA[en]]></category> <category><![CDATA[Hints]]></category> <category><![CDATA[HowTo]]></category> <category><![CDATA[Marketing]]></category> <category><![CDATA[SDK]]></category><guid
isPermaLink="false">http://www.langalaxy.de/?p=153</guid> <description><![CDATA[Retrieving the members of a marketing list is for one reason a little bit trickier than retrieving other entities: there are no messages for operating with the listmember entity. Once you have loaded the marketing list, for which you want to retrieve the members, you have to find out of what type the members are. [...]]]></description> <content:encoded><![CDATA[<p>Retrieving the members of a marketing list is for one reason a little bit trickier than retrieving other entities: there are no messages for operating with the <a
title="listmember" href="http://msdn.microsoft.com/de-de/library/bb957095(en-us).aspx">listmember</a> entity.</p><p>Once you have loaded the marketing list, for which you want to retrieve the members, you have to find out of what type the members are. The type of the members is stored in the <a
title ="membertype" href="http://msdn.microsoft.com/de-de/library/cc153303(en-us).aspx">membertype</a> property of the marketing list.</p><p>Following method returns the name of the member entity type</p><div
class="wp_syntax"><div
class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">internal</span> <span style="color: #6666cc; font-weight: bold;">string</span> GetMemberType<span style="color: #008000;">&#40;</span>CrmNumber crmNumber<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">switch</span> <span style="color: #008000;">&#40;</span>crmNumber<span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">case</span> ListType<span style="color: #008000;">.</span><span style="color: #0000FF;">Account</span><span style="color: #008000;">:</span>
            <span style="color: #0600FF; font-weight: bold;">return</span> EntityName<span style="color: #008000;">.</span><span style="color: #0000FF;">account</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">case</span> ListType<span style="color: #008000;">.</span><span style="color: #0000FF;">Contact</span><span style="color: #008000;">:</span>
            <span style="color: #0600FF; font-weight: bold;">return</span> EntityName<span style="color: #008000;">.</span><span style="color: #0000FF;">contact</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">case</span> ListType<span style="color: #008000;">.</span><span style="color: #0000FF;">Lead</span><span style="color: #008000;">:</span>
            <span style="color: #0600FF; font-weight: bold;">return</span> EntityName<span style="color: #008000;">.</span><span style="color: #0000FF;">lead</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">default</span><span style="color: #008000;">:</span>
            <span style="color: #0600FF; font-weight: bold;">break</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></div></div><p>With this information we can create the <a
href="http://msdn.microsoft.com/de-de/library/bb929258(en-us).aspx">query expression</a> which we use to retrieve the list members.</p><div
class="wp_syntax"><div
class="code"><pre class="csharp" style="font-family:monospace;">BusinessEntityCollection RetrieveMembers<span style="color: #008000;">&#40;</span>list marketinglist<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
&nbsp;
 <span style="color: #6666cc; font-weight: bold;">string</span> targetEntity <span style="color: #008000;">=</span> GetMemberType<span style="color: #008000;">&#40;</span>marketinglist<span style="color: #008000;">.</span><span style="color: #0000FF;">membertype</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
 QueryExpression query <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> QueryExpression
 <span style="color: #008000;">&#123;</span>
   EntityName <span style="color: #008000;">=</span> targetEntity<span style="color: #008000;">;</span>
   ColumnSet <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> AllColumns<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
 <span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span>
&nbsp;
 <span style="color: #008080; font-style: italic;">// link from target entity to listmember</span>
 LinkEntity linkToListMemberEntity <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> LinkEntity
 <span style="color: #008000;">&#123;</span>
   LinkFromEntityName <span style="color: #008000;">=</span> EntityName<span style="color: #008000;">.</span><span style="color: #0000FF;">account</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
   LinkFromAttributeName <span style="color: #008000;">=</span> targetEntity <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;id&quot;</span><span style="color: #008000;">;</span>
   LinkToEntityName <span style="color: #008000;">=</span> EntityName<span style="color: #008000;">.</span><span style="color: #0000FF;">listmember</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
   LinkToAttributeName <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;entityid&quot;</span><span style="color: #008000;">;</span>
 <span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span>
&nbsp;
 <span style="color: #008080; font-style: italic;">//link from listmember to list</span>
 LinkEntity linkToMarketingList <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> LinkEntity
 <span style="color: #008000;">&#123;</span>
   LinkFromEntityName <span style="color: #008000;">=</span> EntityName<span style="color: #008000;">.</span><span style="color: #0000FF;">listmember</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
   LinkFromAttributeName <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;listid&quot;</span><span style="color: #008000;">;</span>
   LinkToEntityName <span style="color: #008000;">=</span> EntityName<span style="color: #008000;">.</span><span style="color: #0000FF;">list</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
   LinkToAttributeName <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;listid&quot;</span><span style="color: #008000;">;</span>
 <span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span>
&nbsp;
 <span style="color: #008080; font-style: italic;">// filter result with the id of the marketing list</span>
 ConditionExpression marketingListIdCondition <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> ConditionExpression
 <span style="color: #008000;">&#123;</span>
   AttributeName <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;listid&quot;</span><span style="color: #008000;">;</span>
   <span style="color: #0600FF; font-weight: bold;">Operator</span> <span style="color: #008000;">=</span> ConditionOperator<span style="color: #008000;">.</span><span style="color: #0000FF;">Equal</span><span style="color: #008000;">;</span>
   Values <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> <span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#123;</span> marketinglist<span style="color: #008000;">.</span><span style="color: #0000FF;">listid</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span> <span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span>
 <span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span>
&nbsp;
 linkToMarketingList<span style="color: #008000;">.</span><span style="color: #0000FF;">LinkCriteria</span> <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> FilterExpression<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
 linkToMarketingList<span style="color: #008000;">.</span><span style="color: #0000FF;">LinkCriteria</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Conditions</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span>marketingListIdCondition<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
 linkToListMemberEntity<span style="color: #008000;">.</span><span style="color: #0000FF;">LinkEntities</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span>linkToMarketingList<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
 query<span style="color: #008000;">.</span><span style="color: #0000FF;">LinkEntities</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span>linkToListMemberEntity<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
 BusinessEntityCollection members <span style="color: #008000;">=</span> service<span style="color: #008000;">.</span><span style="color: #0000FF;">RetrieveMultiple</span><span style="color: #008000;">&#40;</span>query<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
 <span style="color: #0600FF; font-weight: bold;">return</span> members<span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>]]></content:encoded> <wfw:commentRss>http://www.langalaxy.de/2009/07/howto-retrieve-members-of-a-marketing-list/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Rhino Mocks + void</title><link>http://www.langalaxy.de/2009/05/rhino-mocks-void/</link> <comments>http://www.langalaxy.de/2009/05/rhino-mocks-void/#comments</comments> <pubDate>Thu, 14 May 2009 18:35:58 +0000</pubDate> <dc:creator>ckeller</dc:creator> <category><![CDATA[Allgemeines]]></category> <category><![CDATA[de]]></category> <category><![CDATA[Hints]]></category> <category><![CDATA[Rhino Mocks]]></category><guid
isPermaLink="false">http://www.langalaxy.de/?p=86</guid> <description><![CDATA[Methoden ohne Rückgabewert können folgendermaßen gemockt werden Expect.Call&#40;delegate &#123; fooBar.VoidMethod&#40;&#41;; &#125;&#41;; oder mit Lambda-Ausdruck Expect.Call&#40;&#40;&#41; =&#62;&#123; fooBar.VoidMethod&#40;&#41;; &#125;&#41;;]]></description> <content:encoded><![CDATA[<p>Methoden ohne Rückgabewert können folgendermaßen gemockt werden</p><div
class="wp_syntax"><div
class="code"><pre class="csharp" style="font-family:monospace;">Expect<span style="color: #008000;">.</span><span style="color: #0000FF;">Call</span><span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">delegate</span> <span style="color: #008000;">&#123;</span> fooBar<span style="color: #008000;">.</span><span style="color: #0000FF;">VoidMethod</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div><p>oder mit Lambda-Ausdruck</p><div
class="wp_syntax"><div
class="code"><pre class="csharp" style="font-family:monospace;">Expect<span style="color: #008000;">.</span><span style="color: #0000FF;">Call</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">=&gt;</span><span style="color: #008000;">&#123;</span> fooBar<span style="color: #008000;">.</span><span style="color: #0000FF;">VoidMethod</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>]]></content:encoded> <wfw:commentRss>http://www.langalaxy.de/2009/05/rhino-mocks-void/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Object Caching 636/682 objects using disk: basic

Served from: www.langalaxy.de @ 2012-02-07 02:54:10 -->
