<?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>MSCRM Blogger &#187; Microsoft</title>
	<atom:link href="http://mscrmblogger.com/tag/microsoft/feed/" rel="self" type="application/rss+xml" />
	<link>http://mscrmblogger.com</link>
	<description>Achieving it all with Microsoft Dynamics CRM™</description>
	<lastBuildDate>Fri, 09 Jul 2010 14:57:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CRM Workflow Manipulation Library</title>
		<link>http://mscrmblogger.com/2010/07/08/crm-workflow-manipulation-library/</link>
		<comments>http://mscrmblogger.com/2010/07/08/crm-workflow-manipulation-library/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 22:55:43 +0000</pubDate>
		<dc:creator>Carlton Colter</dc:creator>
				<category><![CDATA[Addons]]></category>
		<category><![CDATA[Scoperta]]></category>
		<category><![CDATA[crm]]></category>
		<category><![CDATA[crm 4]]></category>
		<category><![CDATA[crm4]]></category>
		<category><![CDATA[equations]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[microsoft dynamics CRM 4]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[strings]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://mscrmblogger.com/?p=231</guid>
		<description><![CDATA[<p>The <a href="http://manipulationlibrary.codeplex.com/">CRM Workflow Manipulation Library</a> is now on CodePlex.  The CRM Workflow Manipulation Library for CRM is a set of custom workflows for OnPremise Microsoft Dynamics® CRM to solve equations, manipulates strings, perform regex (regular expression) formatting and matching, as well as SoundEx and Metaphone-Like codification.</p>]]></description>
			<content:encoded><![CDATA[<p>Microsoft Dynamics CRM 4.0’s workflow designer is built right into the web-application and provides a way to conditionally perform actions in CRM.  With CRM 4.0 on-premise, custom workflow assemblies can be uploaded to the server and accessed through the web-interface.  The <a href="http://manipulationlibrary.codeplex.com/">CRM Workflow Manipulation Library</a> provides additional workflow actions to perform calculations and manipulate strings.</p>
<p></p>
<p>Two of its most notable capabilities are its ability to perform mathematical equations and phonetic codification solving for duplicate matching.</p>
<p></p>
<p>Sometimes you may want to calculate a percentage based on some of the fields on an opportunity, or you may want to perform a calculation to make a decision on who should work on a particular task.  The solve equation workflow allows you to pass parameters and specify a formula for it to solve.</p>
<p></p>
<p><b>For example:</b></p>
<table>
<tr style="font-weight:bold">
<td>Workflow Field</td>
<td>Value</td>
</tr>
<tr>
<td>Formula:</td>
<td>min(@a,@b)*@c</td>
</tr>
<tr>
<td>@a:</td>
<td>100</td>
</tr>
<tr>
<td>@b:</td>
<td>125</td>
</tr>
<tr>
<td>@c:</td>
<td>4</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td>Result</td>
<td>400</td>
</tr>
</table>
<p>
</p>
<p></p>
<p>The benefit is that the solver can help you calculate values to include in an email or store data back to CRM.  It does more than just basic math and can handle other constants and functions.  One of the constants it can handle is rand, which generates a number from 0 to 1 similar to excel, and it handles randbetween to generate a number between two values.</p>
<p></p>
<p>The Manipulation Library contains two phonetic codification systems, SoundEx and a Metaphone-like system.  Both of these can be used to convert text to a phonetic codified string that can then be compared for duplicate detection.  There are <a href="http://manipulationlibrary.codeplex.com/wikipage?title=Duplicate%20Checking%20with%20Metaphone&amp;referringTitle=Codify%20%28Metaphone%29">complete instructions on how to configure workflow to perform SoundEx or Metaphone duplicate detection</a> in the documentation.</p>
<p></p>
<p>The CRM Workflow Manipulation Library provides Calculation Utilities, RegEx Utilities, and String Utilities.  It is a feature-rich workflow extension that provides the ability to do much more with the data already in your CRM system, and is definitely worth checking out on <a href="http://manipulationlibrary.codeplex.com/">CodePlex</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mscrmblogger.com/2010/07/08/crm-workflow-manipulation-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Workflow: Geocode (and correct) Addresses with Bing Maps</title>
		<link>http://mscrmblogger.com/2010/05/20/geocode_with_bing/</link>
		<comments>http://mscrmblogger.com/2010/05/20/geocode_with_bing/#comments</comments>
		<pubDate>Thu, 20 May 2010 17:59:03 +0000</pubDate>
		<dc:creator>Carlton Colter</dc:creator>
				<category><![CDATA[Integration]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Scoperta]]></category>
		<category><![CDATA[address]]></category>
		<category><![CDATA[bing]]></category>
		<category><![CDATA[bing maps]]></category>
		<category><![CDATA[crm]]></category>
		<category><![CDATA[crm 4]]></category>
		<category><![CDATA[crm4]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[custom workflow]]></category>
		<category><![CDATA[geocode]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[microsoft dynamics CRM 4]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://mscrmblogger.com/?p=221</guid>
		<description><![CDATA[Bing Maps are great.  You can geocode and correct your addresses.  While this isn't anything complicated, it is a good example of a custom workflow that uses an external webservice.]]></description>
			<content:encoded><![CDATA[<p>Bing Maps are great.  You can geocode and correct your addresses.  Depending on your level of queries and types of usage you may need to purchase credits to query Bing Maps, but I thought it was pretty straight forward. If you need to get a Bing Maps account, go <a href="http://www.microsoft.com/maps/developers/">here</a>.</p>
<p>The thing that makes this great is it is workflow.  It is not tied down to an entity.  You can use it on your custom entities, you can geocode your addresses, and correct them.  You can do address verification and geocoding.  You can control what you do using workflow.
</p>
<p>Ok, while this isn&#8217;t anything complicated, I thought it was a good example of a custom workflow that used an external webservice.  <i>Please don&#8217;t forget to create a signed key for your project.</i></p>
<p><b>Workflow Class:</b></p>
<pre name="code" class="csharp">
using System;
using System.ServiceModel;
using System.Text;
using System.Workflow.Activities;
using System.Workflow.ComponentModel;
using BingWorkflow.BingMapsGeo;
using Microsoft.Crm.Sdk;
using Microsoft.Crm.Workflow;
using Microsoft.Win32;

namespace BingWorkflow
{
    [CrmWorkflowActivity("Bing Maps", "Geocode")]
    public class VerifyAddressUsingBingMapsActivity :
        SequenceActivity
    {
        // Activity code goes here. 

        public static DependencyProperty AddressCityProperty = DependencyProperty.Register(
            "AddressCity", typeof (string), typeof (VerifyAddressUsingBingMapsActivity));

        public static DependencyProperty AddressCountryProperty = DependencyProperty.Register(
            "AddressCountry", typeof (string), typeof (VerifyAddressUsingBingMapsActivity));

        public static DependencyProperty AddressLine1Property = DependencyProperty.Register(
            "AddressLine1", typeof (string), typeof (VerifyAddressUsingBingMapsActivity));

        public static DependencyProperty AddressPostalCodeProperty = DependencyProperty.Register(
            "AddressPostalCode", typeof (string), typeof (VerifyAddressUsingBingMapsActivity));

        public static DependencyProperty AddressStateProperty = DependencyProperty.Register(
            "AddressState", typeof (string), typeof (VerifyAddressUsingBingMapsActivity));

        public static DependencyProperty BingKeyProperty = DependencyProperty.Register(
            "BingKey", typeof (string), typeof (VerifyAddressUsingBingMapsActivity));

        public static DependencyProperty OutputCityProperty = DependencyProperty.Register(
            "OutputCity", typeof (string), typeof (VerifyAddressUsingBingMapsActivity));

        public static DependencyProperty OutputCountryProperty = DependencyProperty.Register(
            "OutputCountry", typeof (string), typeof (VerifyAddressUsingBingMapsActivity));

        public static DependencyProperty OutputLatitudeProperty = DependencyProperty.Register(
            "OutputLatitude", typeof (CrmFloat), typeof (VerifyAddressUsingBingMapsActivity));

        public static DependencyProperty OutputLine1Property = DependencyProperty.Register(
            "OutputLine1", typeof (string), typeof (VerifyAddressUsingBingMapsActivity));

        public static DependencyProperty OutputLongitudeProperty = DependencyProperty.Register(
            "OutputLongitude", typeof (CrmFloat), typeof (VerifyAddressUsingBingMapsActivity));

        public static DependencyProperty OutputMultipleFoundProperty = DependencyProperty.Register(
            "OutputMultipleFound", typeof (CrmBoolean), typeof (VerifyAddressUsingBingMapsActivity));

        public static DependencyProperty OutputPostalCodeProperty = DependencyProperty.Register(
            "OutputPostalCode", typeof (string), typeof (VerifyAddressUsingBingMapsActivity));

        public static DependencyProperty OutputStateProperty = DependencyProperty.Register(
            "OutputState", typeof (string), typeof (VerifyAddressUsingBingMapsActivity));

        [CrmInput("Address City")]
        public string AddressCity
        {
            get { return (string)GetValue(AddressCityProperty); }
            set { SetValue(AddressCityProperty, value); }
        }

        [CrmInput("Address Country")]
        public string AddressCountry
        {
            get { return (string)GetValue(AddressCountryProperty); }
            set { SetValue(AddressCountryProperty, value); }
        }

        [CrmInput("Address Line 1")]
        public string AddressLine1
        {
            get { return (string)GetValue(AddressLine1Property); }
            set { SetValue(AddressLine1Property, value); }
        }

        [CrmInput("Address Postal Code")]
        public string AddressPostalCode
        {
            get { return (string)GetValue(AddressPostalCodeProperty); }
            set { SetValue(AddressPostalCodeProperty, value); }
        }

        [CrmInput("Address State Or Province")]
        public string AddressState
        {
            get { return (string)GetValue(AddressStateProperty); }
            set { SetValue(AddressStateProperty, value); }
        }

        [CrmInput("Bing API Key")]
        public string BingKey
        {
            get { return (string)GetValue(BingKeyProperty); }
            set { SetValue(BingKeyProperty, value); }
        }

        [CrmOutput("City")]
        public string OutputCity
        {
            get { return (string)GetValue(OutputCityProperty); }
            set { SetValue(OutputCityProperty, value); }
        }

        [CrmOutput("Country Or Region")]
        public string OutputCountry
        {
            get { return (string)GetValue(OutputCountryProperty); }
            set { SetValue(OutputCountryProperty, value); }
        }

        [CrmOutput("Latitude")]
        public CrmFloat OutputLatitude
        {
            get { return (CrmFloat)GetValue(OutputLatitudeProperty); }
            set { SetValue(OutputLatitudeProperty, value); }
        }

        [CrmOutput("Line 1")]
        public string OutputLine1
        {
            get { return (string)GetValue(OutputLine1Property); }
            set { SetValue(OutputLine1Property, value); }
        }

        [CrmOutput("Longitude")]
        public CrmFloat OutputLongitude
        {
            get { return (CrmFloat)GetValue(OutputLongitudeProperty); }
            set { SetValue(OutputLongitudeProperty, value); }
        }

        [CrmOutput("Multiple Address Found")]
        public CrmBoolean OutputMultipleFound
        {
            get { return (CrmBoolean)GetValue(OutputMultipleFoundProperty); }
            set { SetValue(OutputMultipleFoundProperty, value); }
        }

        [CrmOutput("Postal Code")]
        public string OutputPostalCode
        {
            get { return (string)GetValue(OutputPostalCodeProperty); }
            set { SetValue(OutputPostalCodeProperty, value); }
        }

        [CrmOutput("State Or Province")]
        public string OutputState
        {
            get { return (string)GetValue(OutputStateProperty); }
            set { SetValue(OutputStateProperty, value); }
        }

        protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
        {
            // Reset Outputs
            OutputLatitude = new CrmFloat();
            OutputLongitude = new CrmFloat();
            OutputLine1 = String.Empty;
            OutputCity = String.Empty;
            OutputState = String.Empty;
            OutputPostalCode = String.Empty;
            OutputMultipleFound = new CrmBoolean {Value = false};

            var key = BingKey;
            if (String.IsNullOrEmpty(key) || key.ToLower() == "registry")
            {
                key = GetAPIKeyFromRegistry();
            }

            // Create Bing Maps Request
            var bingRequest = new GeocodeRequest
                              {
                                  Credentials = new Credentials {ApplicationId = key},
                                  Query = AddressLine1 + ", " +
                                          AddressCity + ", " +
                                          AddressState + ", " +
                                          AddressPostalCode + ", " +
                                          AddressCountry
                              };

            // Filter for High Confidence
            var filters = new ConfidenceFilter[1];
            filters[0] = new ConfidenceFilter {MinimumConfidence = Confidence.High};
            bingRequest.Options = new GeocodeOptions {Filters = filters};

            // Create Client
            GeocodeServiceClient bingClient = null;
            try
            {
                var geoBinding = new BasicHttpBinding(BasicHttpSecurityMode.None)
                                 {
                                     Name = "BasicHttpBinding_IGeocodeService",
                                     CloseTimeout = new TimeSpan(0, 1, 0),
                                     OpenTimeout = new TimeSpan(0, 1, 0),
                                     ReceiveTimeout = new TimeSpan(0, 10, 0),
                                     SendTimeout = new TimeSpan(0, 1, 0),
                                     AllowCookies = false,
                                     BypassProxyOnLocal = false,
                                     HostNameComparisonMode = HostNameComparisonMode.StrongWildcard,
                                     MaxBufferSize = 65536,
                                     MaxBufferPoolSize = 524288,
                                     MaxReceivedMessageSize = 65536,
                                     MessageEncoding = WSMessageEncoding.Text,
                                     TextEncoding = Encoding.UTF8,
                                     TransferMode = TransferMode.Buffered,
                                     UseDefaultWebProxy = true
                                 };

                var geoEA =
                    new EndpointAddress("http://dev.virtualearth.net/webservices/v1/geocodeservice/GeocodeService.svc");

                bingClient = new GeocodeServiceClient(geoBinding, geoEA);

                var bingResponse = bingClient.Geocode(bingRequest);

                if (bingResponse.Results != null &#038;&#038; bingResponse.Results.Length > 0)
                {
                    if (bingResponse.Results.Length > 1)
                    {
                        OutputMultipleFound.Value = true;
                    }

                    var bingResult = bingResponse.Results[0];

                    if (bingResult.Locations != null &#038;&#038; bingResult.Locations.Length > 0)
                    {
                        var bingLocation = bingResult.Locations[0];
                        OutputLatitude.Value = bingLocation.Latitude;
                        OutputLongitude.Value = bingLocation.Longitude;
                    }

                    var bingAddress = bingResult.Address;

                    OutputLine1 = bingAddress.AddressLine;
                    OutputPostalCode = bingAddress.PostalCode;
                    OutputCountry = bingAddress.CountryRegion;

                    OutputCity = String.IsNullOrEmpty(bingAddress.PostalTown)
                                     ? bingAddress.Locality
                                     : bingAddress.PostalTown;
                    OutputState = String.IsNullOrEmpty(bingAddress.AdminDistrict)
                                      ? bingAddress.District
                                      : bingAddress.AdminDistrict;
                }
            }
            catch (Exception ex)
            {
                throw new WorkflowTerminatedException(
                    "There was an error openning the connection to Bing Maps.", ex);
            }
            finally
            {
                // Close the client
                if (bingClient != null)
                {
                    bingClient.Close();
                }
            }

            return base.Execute(executionContext);
        }

        private static string GetAPIKeyFromRegistry()
        {
            // Opening the registry key
            var key = Registry.LocalMachine;
            if (key != null)
            {
                key = key.OpenSubKey("Software\\Microsoft Geocoder");
            }

            return key != null ? key.GetValue("APIKey").ToString() : null;
        }
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mscrmblogger.com/2010/05/20/geocode_with_bing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding the queue name to a saved advanced find for cases (incidents)</title>
		<link>http://mscrmblogger.com/2010/02/18/adding-the-queue-name-to-a-saved-advanced-find-for-cases-incidents/</link>
		<comments>http://mscrmblogger.com/2010/02/18/adding-the-queue-name-to-a-saved-advanced-find-for-cases-incidents/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 18:56:43 +0000</pubDate>
		<dc:creator>Carlton Colter</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Scoperta]]></category>
		<category><![CDATA[advanced find]]></category>
		<category><![CDATA[cases]]></category>
		<category><![CDATA[crm4]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[incidents]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[microsoft dynamics CRM 4]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://mscrmblogger.com/?p=212</guid>
		<description><![CDATA[<p>Unfortunately, CRM does not currently support adding the queue to a case advanced find.  However, that doesn't mean it can't be done.  Follow the steps in this article to modify your fetchXML and your layoutXML to have the queue name show up in the advanced find.</p>]]></description>
			<content:encoded><![CDATA[<p>Unfortunately, CRM does not currently support adding the queue to a case advanced find.  However, that doesn&#8217;t mean it can&#8217;t be done.</p>
<p>Please note, that this is not a supported modification or change.</p>
<p>Follow the steps below to modify your fetchXML and your layoutXML to have the queue name show up in the advanced find. You can even update the name in the UserQueryBase to rename your advanced find to something better.</p>
<ol>
<li>Create your advanced find, setup your filters etc.</li>
<li>Save your advanced find (name it something unique)</li>
<li>Get the guid of your advanced find (using open pop-ups in a new tab or using a select statement to look it up in the db.
<pre name="code" class="sql">
SELECT UserQueryID FROM UserQueryBase WHERE Name='Cases (w/Queue Name) - IT Example'
</pre>
</li>
<li>Then using the id, execute the following code to add the queue name:
<pre name="code" class="sql">
UPDATE UserQueryBase SET
FetchXml = REPLACE(FetchXml,'&lt;/entity&gt;',
'&lt;link-entity name=&quot;queueitem&quot; from=&quot;objectid&quot; to=&quot;incidentid&quot; visible=&quot;false&quot; link-type=&quot;outer&quot; alias=&quot;qi&quot;&gt;
&lt;link-entity name=&quot;queue&quot; from=&quot;queueid&quot; to=&quot;queueid&quot; visible=&quot;false&quot; link-type=&quot;outer&quot; alias=&quot;Q&quot;&gt;
&lt;attribute name=&quot;name&quot;/&gt;&lt;/link-entity&gt;&lt;/link-entity&gt;&lt;/entity&gt;')
,LayoutXML = REPLACE(LayoutXml,'&lt;/row&gt;',
'&lt;cell name=&quot;Q.name&quot; width=&quot;200&quot; disableSorting=&quot;0&quot;/&gt;&lt;/row&gt;')
-- Make sure to change the UserQueryID
WHERE UserQueryID='71F94C46-F217-DF11-A241-0050569B4FF3'
</pre>
</li>
<li>If you have your advanced find window open, close and reopen it before trying to run it and see the &quot;Q.name&quot; column.</li>
</ol>
<p>If you have any problems or questions, let me know.  Again this is setup to work on advanced find for cases, I&#8217;m sure it could be modified for other queue-able entities.</p>
]]></content:encoded>
			<wfw:commentRss>http://mscrmblogger.com/2010/02/18/adding-the-queue-name-to-a-saved-advanced-find-for-cases-incidents/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lookup a lookup on another entity using JScript</title>
		<link>http://mscrmblogger.com/2009/10/15/lookup-a-lookup-on-another-entity-using-jscript/</link>
		<comments>http://mscrmblogger.com/2009/10/15/lookup-a-lookup-on-another-entity-using-jscript/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 20:37:32 +0000</pubDate>
		<dc:creator>Carlton Colter</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[crm]]></category>
		<category><![CDATA[crm 4]]></category>
		<category><![CDATA[crm4]]></category>
		<category><![CDATA[jscript]]></category>
		<category><![CDATA[lookup]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[microsoft dynamics CRM 4]]></category>

		<guid isPermaLink="false">http://mscrmblogger.com/?p=188</guid>
		<description><![CDATA[Do you need the value of a lookup?  I have written this bit of code to look a lookup value stored on another entity.  Like finding the Customer lookup on an Incident (Case).  Here is a bit of code that can lookup a lookup on any entity in CRM.]]></description>
			<content:encoded><![CDATA[<p>Do you need the value of a lookup?  I have written this bit of code to look a lookup value stored on another entity.  Like finding the Customer lookup on an Incident (Case).</p>
<ul>
<li>ID: The unique id value of the entity&#8217;s object</li>
<li>ENTITY: The name of the entity to lookup</li>
<li>IDFIELD: The entity&#8217;s primary id field name, like accountid, incidentid, etc.</li>
<li>LOOKUPFIELD: The name of the field you want to lookup, like customerid</li>
<li>RETURNTYPE: The name of the entity&#8217;s return type, like contact or account.  If there are multiple possible, then specify &#8220;multiple&#8221; and it will pass back the type instead of type name.  If you specify &#8220;value&#8221; it will return just the value.</li>
</ul>
<hr />
<pre name="code" class="javascript">
function getEntityLookup(id, entity, idfield, lookupfield, returntype) {
    var xml = &quot;&quot; +
	&quot;&lt; ?xml version='1.0' encoding='utf-8'?&gt;&quot; +
	&quot;&lt;soap :Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'&quot; +
	&quot; xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'&quot; +
	&quot; xmlns:xsd='http://www.w3.org/2001/XMLSchema'&gt;&quot; +
	GenerateAuthenticationHeader() +
	&quot;&lt;/soap&gt;&lt;soap :Body&gt;&quot; +
	&quot;&lt;fetch xmlns='http://schemas.microsoft.com/crm/2007/WebServices'&gt;&quot; +
	&quot;&lt;fetchxml&gt;&quot; +
	&quot; &amp;lt;fetch mapping='logical' count='1'&amp;gt;&quot; +
	&quot; &amp;lt;entity name='&quot; + entity + &quot;'&amp;gt;&quot; +
	&quot; &amp;lt;attribute name='&quot; + lookupfield + &quot;' /&amp;gt;&quot; +
	&quot; &amp;lt;filter&amp;gt;&quot; +
	&quot; &amp;lt;condition attribute='&quot; + idfield + &quot;' operator='eq' value='&quot; + id + &quot;' /&amp;gt;&quot; +
	&quot; &amp;lt;/filter&amp;gt;&quot; +
	&quot; &amp;lt;/entity&amp;gt;&quot; +
	&quot; &amp;lt;/fetch&amp;gt;&quot; +
	&quot;&lt;/fetchxml&gt;&quot; +
	&quot;&lt;/fetch&gt;&quot; +
	&quot;&lt;/soap&gt;&quot; +
	&quot;&quot;;

    var xmlHttpRequest = new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;);
    xmlHttpRequest.Open(&quot;POST&quot;, &quot;/mscrmservices/2007/CrmService.asmx&quot;, false);
    xmlHttpRequest.setRequestHeader(&quot;SOAPAction&quot;, &quot;http://schemas.microsoft.com/crm/2007/WebServices/Fetch&quot;);
    xmlHttpRequest.setRequestHeader(&quot;Content-Type&quot;, &quot;text/xml; charset=utf-8&quot;);
    xmlHttpRequest.setRequestHeader(&quot;Content-Length&quot;, xml.length);
    xmlHttpRequest.send(xml);

    var resultXml = xmlHttpRequest.responseXML;
    var resultSet = resultXml.text;
    resultSet.replace('&amp;lt;', '&lt; ');
    resultSet.replace('&amp;gt;', '&gt;');

    var oXmlDoc = new ActiveXObject(&quot;Microsoft.XMLDOM&quot;);
    oXmlDoc.async = false;
    oXmlDoc.loadXML(resultSet);

    var result = oXmlDoc.getElementsByTagName(lookupfield);
    if (returntype == 'value') return result[0].text;

    var lookupItem = new Object();
    for (var i = 0; i &lt; result[0].attributes.length; i++) {
        var att = result[0].attributes[i];
        if (returntype == 'multiple' &amp;&amp; att.name == &quot;type&quot;) lookupItem.type = att.value;
        if (att.name == &quot;name&quot;) lookupItem.name = att.value;
    }
    if (returntype != 'multiple') lookupItem.typename = returntype;

    lookupItem.id = result[0].text;

    return lookupItem;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mscrmblogger.com/2009/10/15/lookup-a-lookup-on-another-entity-using-jscript/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CRM Common Javascript File</title>
		<link>http://mscrmblogger.com/2009/10/13/crm-common-javascript-file/</link>
		<comments>http://mscrmblogger.com/2009/10/13/crm-common-javascript-file/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 21:10:46 +0000</pubDate>
		<dc:creator>Carlton Colter</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[crm]]></category>
		<category><![CDATA[crm 4]]></category>
		<category><![CDATA[crm4]]></category>
		<category><![CDATA[jscript]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[microsoft dynamics CRM 4]]></category>
		<category><![CDATA[onchange]]></category>
		<category><![CDATA[onload event]]></category>

		<guid isPermaLink="false">http://mscrmblogger.com/?p=186</guid>
		<description><![CDATA[Need to reference an external javascript file to make functions available in change events and in an onload?  Here's how!]]></description>
			<content:encoded><![CDATA[<p>I use a lot of the same function on multiple pages, and I think a lot of you do to.  You can create a common javascript file and load it during an onload event, extending the functionality of your CRM.  This is particularly useful because it reduces the amount of changes you have to make when you want to change how something works.</p>
<p>Code reuse is important, and I believe in creating libraries and using libraries. Javascript files are libraries, and they are cached.  So if you update a Javascript file you are loading this way, make sure your users clear their cache.</p>
<pre name="code" class="javascript">
function loadjs(filename, onload){
  var scriptfile=document.createElement('script');
  scriptfile.setAttribute("type","text/javascript");
  scriptfile.setAttribute("src", filename);
  scriptfile.onreadystatechange=onload;
  document.getElementsByTagName("head")[0].appendChild(scriptfile);
}

loadjs("/MoreJavascript/tools.js", function(){
	if (this.readyState == 'loaded' || this.readyState == 'complete') {
		FunctionInJavascriptFile();
		this.onreadystatechanged=null;
	}
});
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mscrmblogger.com/2009/10/13/crm-common-javascript-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Editing an Advanced Find Query in Excel</title>
		<link>http://mscrmblogger.com/2009/10/12/editing-an-advanced-find-query-in-excel/</link>
		<comments>http://mscrmblogger.com/2009/10/12/editing-an-advanced-find-query-in-excel/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 11:28:44 +0000</pubDate>
		<dc:creator>Carlton Colter</dc:creator>
				<category><![CDATA[Addons]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[advanced find]]></category>
		<category><![CDATA[crm]]></category>
		<category><![CDATA[crm 4]]></category>
		<category><![CDATA[crm4]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[microsoft dynamics CRM 4]]></category>

		<guid isPermaLink="false">http://mscrmblogger.com/?p=161</guid>
		<description><![CDATA[Here is a video tutorial of how to take a case advanced find, edit the query, troubleshoot errors in SQL Management Studio, and update your excel query.]]></description>
			<content:encoded><![CDATA[<p>Here is a video tutorial of how to take a case advanced find, edit the query, troubleshoot errors in SQL Management Studio, and update your excel query.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/tr1FXu-tVHM&#038;hl=en&#038;fs=1&#038;ap=%2526fmt%3D22"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/tr1FXu-tVHM&#038;hl=en&#038;fs=1&#038;ap=%2526fmt%3D22" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>The steps are:</p>
<ol>
<li>Run an advanced find in CRM</li>
<li>Export it to Excel as a Dynamic Worksheet</li>
<li>Open it, save it as an excel file.</li>
<li>In Excel 2007, Click on Data in the ribbon, then Connections.</li>
<li>Click Properties</li>
<li>Click on Definition tab, edit the query</li>
<li>Click ok, then click close</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://mscrmblogger.com/2009/10/12/editing-an-advanced-find-query-in-excel/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Changing PickList Values on Yes/No Form Field Change</title>
		<link>http://mscrmblogger.com/2009/10/03/changing-picklist-values-on-yesno-form-field-change/</link>
		<comments>http://mscrmblogger.com/2009/10/03/changing-picklist-values-on-yesno-form-field-change/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 02:32:02 +0000</pubDate>
		<dc:creator>Carlton Colter</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[boolean]]></category>
		<category><![CDATA[crm]]></category>
		<category><![CDATA[crm 4]]></category>
		<category><![CDATA[crm4]]></category>
		<category><![CDATA[field]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jscript]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[microsoft dynamics CRM 4]]></category>
		<category><![CDATA[onchange]]></category>
		<category><![CDATA[picklist]]></category>

		<guid isPermaLink="false">http://mscrmblogger.com/?p=156</guid>
		<description><![CDATA[<p>Recently on the Microsoft forums someone asked how to change the values of a picklist based on the yes no value of a boolean field.  Just add this script to the OnChange event of the yes/no field.</p>]]></description>
			<content:encoded><![CDATA[<p>Recently on the Microsoft forums someone asked how to change the values of a picklist based on the yes no value of a boolean field.  Just add this script to the OnChange event of the yes/no field.</p>
<p><a href="http://technet.microsoft.com/en-us/library/aa681845.aspx">This technet page shows some of the functions on different form fields.</a></p>
<p><strong>Here is an example of how to change the picklist based on a yes/no field:</strong></p>
<pre name="code" class="javascript">
function CreatePicklistValue(Name,Value)
{
	var retval = new Array();
	retval[0]  = Name;
	retval[1]  = Value;
	return retval;
}

function BuildPickList(picklist, valuelist)
{
	var options = picklist.Options;
	for(var i=0; i&lt;options.length; i++)
	{
		var option = options[i];
		picklist.DeleteOption(option.DataValue);
	}
	for(var j=0; j&lt;valuelist.length; j++)
	{
		var listitem = valuelist[j];
		picklist.AddOption(listitem[0], listitem[1]);
	}
}

var lista = new Array();
lista[0] = CreatePicklistValue('Alpha',0);
lista[1] = CreatePicklistValue('Beta',1);

var listb = new Array();
listb[0] = CreatePicklistValue('Charlie',2);
listb[1] = CreatePicklistValue('Delta',3);

var uselista = crmForm.all.YesNo.DataValue;
var picklist = crmForm.all.Picklist;

if (uselista==true) {
   BuildPickList(picklist, lista);
} else {
   BuildPickList(picklist, listb);
}
</pre>
<p>You just need to change the values of lista and listb, and the crmForm.all.YesNo and crmForm.all.Picklist.</p>
]]></content:encoded>
			<wfw:commentRss>http://mscrmblogger.com/2009/10/03/changing-picklist-values-on-yesno-form-field-change/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set a default email template for new emails on cases.</title>
		<link>http://mscrmblogger.com/2009/10/02/set-a-default-email-template-for-new-emails-on-cases/</link>
		<comments>http://mscrmblogger.com/2009/10/02/set-a-default-email-template-for-new-emails-on-cases/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 22:31:58 +0000</pubDate>
		<dc:creator>Carlton Colter</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[crm]]></category>
		<category><![CDATA[crm 4]]></category>
		<category><![CDATA[crm4]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jscript]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[microsoft dynamics CRM 4]]></category>
		<category><![CDATA[onload event]]></category>

		<guid isPermaLink="false">http://mscrmblogger.com/?p=152</guid>
		<description><![CDATA[<p>In response to <a href="http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/2d2c28ba-891d-4ebc-9c54-92c7cc21a034">Peter Bergman's post on the CRM forums</a>, I traversed Microsoft's code.  I determined that the ApplyTemplate loads a specific page, and on that page, the ok button sets the information on the calling page.  I melded the ApplyTemplate and ok methods together to create LoadTemplate provided below.  With the right parameters, it will set the default template.</p>]]></description>
			<content:encoded><![CDATA[<p>In response to <a href="http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/2d2c28ba-891d-4ebc-9c54-92c7cc21a034">Peter Bergman&#8217;s post on the CRM forums</a>, I traversed Microsoft&#8217;s code.  I determined that the ApplyTemplate loads a specific page, and on that page, the ok button sets the information on the calling page.  I melded the ApplyTemplate and ok methods together to create LoadTemplate provided below.  With the right parameters, it will set the default template.</p>
<pre name="code" class="javascript">
function LoadTemplate(templateid, objectid, objecttypecode)
{
    var command = new RemoteCommand("EmailTemplateService", "GetInstantiatedEmailTemplate");
    command.SetParameter("templateId", templateid );
    command.SetParameter("objectId", objectid);
    command.SetParameter("objectTypeCode", objecttypecode);

    var result = command.Execute();

    if (result.Success)
    {
        var o = new Object();
        o.EmailBody = "";
        o.EmailSubject = "";
        if(typeof(result.ReturnValue) == "string")
        {
            oXml = CreateXmlDocument(false);
            oXml.loadXML(result.ReturnValue);
            o.EmailBody = oXml.selectSingleNode("template/body").text;
            o.EmailSubject = oXml.selectSingleNode("template/subject").text;

            crmForm.all.description.InsertValue( o.EmailBody  );
            if( !IsNull( o.EmailSubject ) &#038;&#038; o.EmailSubject.length > 0 )
            {
                crmForm.all.subject.DataValue =
                    CrmEncodeDecode.CrmHtmlDecode(o.EmailSubject).substr(0, crmForm.all.subject.MaxLength);
            }
        }
    }
}
</pre>
<p>To set the default template, you need the templateid, you can get this by opening the template and hitting CTRL-N, or you can just operate in tab mode and see all the id&#8217;s and urls at all times. I prefer that view&#8230;  The below code uses the templateid to set a default email template when a new email is created from a case, account, and contact.  You could easily extend this for other templates and entities.  Currently I am setting them all to the same template, which won&#8217;t work.</p>
<pre name="code" class="javascript">
var CRM_FORM_TYPE_CREATE = 1;
if (crmForm.FormType==CRM_FORM_TYPE_CREATE)
{
    var otype = 0;
    var tmpid = '';
    switch (crmForm.all.regardingobjectid.DataValue[0].typename)
    {
        case 'incident': otype=112; tmpid='{F8E179BF-8E7C-DA11-BF9A-00142216345E}'; break;
        case 'account':  otype=1;   tmpid='{F8E179BF-8E7C-DA11-BF9A-00142216345E}'; break;
	case 'contact':  otype=2;   tmpid='{F8E179BF-8E7C-DA11-BF9A-00142216345E}'; break;
        default: return;
    }

    var oid = crmForm.all.regardingobjectid.DataValue[0].id;

    if (tmpid==undefined || tmpid==null) return;

    LoadTemplate(tmpid, oid, otype);
}
</pre>
<p>This could be extended using my <a href="http://mscrmblogger.com/2009/09/30/get-current-users-business-unit-for-hiding-fields/">business unit</a> lookup or getting roles assigned to a user..</p>
<p>Let me know if you have any questions &#8211; or if you figure out a way to get the id of a template from the name of one&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://mscrmblogger.com/2009/10/02/set-a-default-email-template-for-new-emails-on-cases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove special characters on value change.</title>
		<link>http://mscrmblogger.com/2009/10/01/remove-special-characters-on-value-change/</link>
		<comments>http://mscrmblogger.com/2009/10/01/remove-special-characters-on-value-change/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 15:02:21 +0000</pubDate>
		<dc:creator>Carlton Colter</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[crm4]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jscript]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[microsoft dynamics CRM 4]]></category>
		<category><![CDATA[onchange]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://mscrmblogger.com/?p=150</guid>
		<description><![CDATA[This blog entry contains some helpful information about removing special characters from a string using javascript.  I was able to modify it to be just a few  of code in an onchange event.  Just rename new_name to the attribute your correcting.

if (crmForm.all.new_name.DataValue &#038;&#038; crmForm.all.new_name.DataValue.length >0)
{
crmForm.all.new_name.DataValue = crmForm.all.new_name.DataValue.replace(/[^a-zA-Z 0-9]+/g,'');
}

]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.developersnippets.com/2007/05/12/remove-special-characters-like-etc-from-a-string-using-javascript/">This blog entry</a> contains some helpful information about removing special characters from a string using javascript.  I was able to modify it to be just a few  of code in an onchange event.  Just rename new_name to the attribute your correcting.</p>
<pre name="code" class="javascript">
if (crmForm.all.new_name.DataValue &#038;&#038; crmForm.all.new_name.DataValue.length >0)
{
crmForm.all.new_name.DataValue = crmForm.all.new_name.DataValue.replace(/[^a-zA-Z 0-9]+/g,'');
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mscrmblogger.com/2009/10/01/remove-special-characters-on-value-change/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>QueueItem RSS &#8211; An Example Of CRM RSS</title>
		<link>http://mscrmblogger.com/2009/09/30/queueitem-rss-an-example-of-crm-rss/</link>
		<comments>http://mscrmblogger.com/2009/09/30/queueitem-rss-an-example-of-crm-rss/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 20:53:11 +0000</pubDate>
		<dc:creator>Carlton Colter</dc:creator>
				<category><![CDATA[Addons]]></category>
		<category><![CDATA[crm]]></category>
		<category><![CDATA[crm 4]]></category>
		<category><![CDATA[crm sdk]]></category>
		<category><![CDATA[crm4]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[microsoft dynamics CRM 4]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[questions]]></category>

		<guid isPermaLink="false">http://mscrmblogger.com/?p=143</guid>
		<description><![CDATA[The Notification Accelerator on Codeplex does not offer a queueitem RSS feed.  I'm not sure why, but here is a simple solution to display an RSS feed.  It defaults to the current user's queues, but if the q=blah is specified in address then all queueitems in any queue with blah in it will be displayed.]]></description>
			<content:encoded><![CDATA[<p>The Notification Accelerator on Codeplex does not offer a queueitem RSS feed.  I&#8217;m not sure why, but here is a simple solution to display an RSS feed.  It defaults to the current user&#8217;s queues, but if the q=blah is specified in address then all queueitems in any queue with blah in it will be displayed.  Please feel free to post your comments.  I did not spend a lot of time on this and I think sql would be quicker.  If you find a method that is quick and easy that displays the queue name and queue items, please post it.</p>
<p>crmsdk is my http://crm/MSCrmServices/2007/CrmService.asmx web reference</p>
<pre name="code" class="csharp">
using System;
using System.Net;
using System.Text;
using System.Web.UI;
using System.Xml;
using CRMQIRSS.crmsdk;

namespace CRMQIRSS
{
    public partial class _Default : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var QueueName = String.Empty;

            try
            {
                QueueName = Request[&quot;q&quot;];
            }
            catch
            {
                // Ignore Errors
            }

            // Clear Any Response
            Response.Clear();
            Response.ContentType = &quot;text/xml&quot;;

            var xtwFeed = new XmlTextWriter(Response.OutputStream, Encoding.UTF8);
            xtwFeed.WriteStartDocument();
            // Setup Feed

            xtwFeed.WriteStartElement(&quot;rss&quot;);
            xtwFeed.WriteAttributeString(&quot;version&quot;, &quot;2.0&quot;);

            // Setup Channel
            xtwFeed.WriteStartElement(&quot;channel&quot;);
            xtwFeed.WriteElementString(&quot;title&quot;, QueueName);
            xtwFeed.WriteElementString(&quot;link&quot;, &quot;http://www.mscrmblogger.com&quot;);
            xtwFeed.WriteElementString(&quot;ttl&quot;, &quot;5&quot;);
            xtwFeed.WriteElementString(&quot;description&quot;, &quot;The most technical and solution rich CRM blog.&quot;);
            xtwFeed.WriteElementString(&quot;copyright&quot;, &quot;Copyright 2009 mscrmblogger.com. All rights reserved.&quot;);

            // Get the Dataset
            BusinessEntityCollection becQueueItems;
            if (String.IsNullOrEmpty(QueueName))
            {
                becQueueItems = GetQueueItemsByCurrentUser();
            }
            else
            {
                becQueueItems = GetQueueItemsByName(QueueName);
            }

            foreach (var be in becQueueItems.BusinessEntities)
            {
                var qi = (queueitem) be;

                var description = &quot;Created: &quot; + Convert.ToDateTime(qi.createdon.Value).ToString(&quot;f&quot;);

                xtwFeed.WriteStartElement(&quot;item&quot;);

                xtwFeed.WriteElementString(&quot;title&quot;, qi.title);

                xtwFeed.WriteElementString(&quot;description&quot;, description);

                String objecttypecode;
                switch (qi.objecttypecode.Value)
                {
                    case &quot;incident&quot;:
                        objecttypecode = &quot;112&quot;;
                        break;
                    case &quot;task&quot;:
                        objecttypecode = &quot;4212&quot;;
                        break;
                    case &quot;phonecall&quot;:
                        objecttypecode = &quot;4202&quot;;
                        break;
                    case &quot;letter&quot;:
                        objecttypecode = &quot;4207&quot;;
                        break;
                    case &quot;serviceappointment&quot;:
                        objecttypecode = &quot;4214&quot;;
                        break;
                    case &quot;fax&quot;:
                        objecttypecode = &quot;4204&quot;;
                        break;
                    case &quot;email&quot;:
                        objecttypecode = &quot;4202&quot;;
                        break;
                    case &quot;campaignactivity&quot;:
                        objecttypecode = &quot;4402&quot;;
                        break;
                    case &quot;campaignresponse&quot;:
                        objecttypecode = &quot;4401&quot;;
                        break;
                    default:
                        objecttypecode = &quot;0&quot;;
                        break;
                }

                xtwFeed.WriteElementString(&quot;link&quot;,
                                           &quot;http://crm/CRMReports/viewer/drillopen.aspx?ID=&quot; + qi.objectid.Value +
                                           &quot;&amp;OTC=&quot; + objecttypecode);

                xtwFeed.WriteElementString(&quot;pubDate&quot;, Convert.ToDateTime(qi.enteredon.Value).ToString(&quot;f&quot;));

                xtwFeed.WriteElementString(&quot;author&quot;, qi.createdby.name);

                //TODO: Lookup the queue...  this would be quicker (and easier) with SQL...
                //xtwFeed.WriteElementString(&quot;category&quot;, &quot;queue/&quot; + qi.queueid);

                xtwFeed.WriteEndElement();
            }

            // Close all tags
            xtwFeed.WriteEndElement();
            xtwFeed.WriteEndElement();
            xtwFeed.WriteEndDocument();
            xtwFeed.Flush();
            xtwFeed.Close();
            Response.End();
        }

        private CrmService GetCrmServiceConnection(String Organization)
        {
            var token = new CrmAuthenticationToken();
            token.AuthenticationType = 0; //AD
            token.OrganizationName = Organization;

            var crmService = new CrmService();
            crmService.CrmAuthenticationTokenValue = token;
            crmService.Credentials = CredentialCache.DefaultCredentials;

            return crmService;
        }

        private BusinessEntityCollection FetchDataSet(string fetchXml)
        {
            var service = GetCrmServiceConnection(&quot;OrganizationXYZ&quot;);

            var request = new FetchXmlToQueryExpressionRequest();
            request.FetchXml = fetchXml;

            var response = (FetchXmlToQueryExpressionResponse) service.Execute(request);

            var items = service.RetrieveMultiple(response.Query);

            return items;
        }

        private BusinessEntityCollection GetQueueItemsByName(String queueName)
        {
            var fetchXML = &quot;&lt;fetch mapping=\&quot;logical\&quot; count=\&quot;50\&quot; distinct=\&quot;true\&quot;&gt;&quot; +
                           &quot;  &lt;entity name=\&quot;queueitem\&quot;&gt;&quot; +
                           &quot;    &lt;all-attributes /&gt;&quot; +
                           &quot;    &lt;link-entity name=\&quot;queue\&quot; from=\&quot;queueid\&quot; to=\&quot;queueid\&quot;&gt;&quot; +
                           &quot;      &lt;attribute name=\&quot;name\&quot; /&gt;&quot; +
                           &quot;      &lt;filter&gt;&quot; +
                           &quot;        &lt;condition attribute=\&quot;name\&quot; operator=\&quot;like\&quot; value=\&quot;%&quot; +
                           queueName +
                           &quot;%\&quot; /&gt;&quot; +
                           &quot;      &lt;/filter&gt;&quot; +
                           &quot;    &lt;/link-entity&gt;&quot; +
                           &quot;  &lt;/entity&gt;&quot; +
                           &quot;&lt;/fetch&gt;&quot;;

            return FetchDataSet(fetchXML);
        }

        private BusinessEntityCollection GetQueueItemsByCurrentUser()
        {
            var fetchXML = &quot;&lt;fetch mapping=\&quot;logical\&quot; count=\&quot;50\&quot; distinct=\&quot;true\&quot;&gt;&quot; +
                           &quot;  &lt;entity name=\&quot;queueitem\&quot;&gt;&quot; +
                           &quot;    &lt;all-attributes /&gt;&quot; +
                           &quot;    &lt;link-entity name=\&quot;queue\&quot; from=\&quot;queueid\&quot; to=\&quot;queueid\&quot;&gt;&quot; +
                           &quot;      &lt;attribute name=\&quot;name\&quot; /&gt;&quot; +
                           &quot;      &lt;filter&gt;&quot; +
                           &quot;        &lt;condition attribute=\&quot;primaryuserid\&quot; operator=\&quot;eq-userid\&quot; /&gt;&quot; +
                           &quot;      &lt;/filter&gt;&quot; +
                           &quot;    &lt;/link-entity&gt;&quot; +
                           &quot;  &lt;/entity&gt;&quot; +
                           &quot;&lt;/fetch&gt;&quot;;

            return FetchDataSet(fetchXML);
        }
    }
}
</pre>
<p>Total time spent on this: 45 minutes</p>
]]></content:encoded>
			<wfw:commentRss>http://mscrmblogger.com/2009/09/30/queueitem-rss-an-example-of-crm-rss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
