<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Microsoft CRM Blog</title>
	<atom:link href="http://promicrosoftcrm.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://promicrosoftcrm.wordpress.com</link>
	<description>Blogging CRM as i Learn</description>
	<lastBuildDate>Wed, 18 Nov 2009 01:10:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='promicrosoftcrm.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Microsoft CRM Blog</title>
		<link>http://promicrosoftcrm.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://promicrosoftcrm.wordpress.com/osd.xml" title="Microsoft CRM Blog" />
	<atom:link rel='hub' href='http://promicrosoftcrm.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Javascript to Get Current user ID</title>
		<link>http://promicrosoftcrm.wordpress.com/2009/11/18/javascript-to-get-current-user-id/</link>
		<comments>http://promicrosoftcrm.wordpress.com/2009/11/18/javascript-to-get-current-user-id/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 01:06:35 +0000</pubDate>
		<dc:creator>CRM</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://promicrosoftcrm.wordpress.com/2009/11/18/javascript-to-get-current-user-id/</guid>
		<description><![CDATA[The following function when called gets the GUID of current user<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=promicrosoftcrm.wordpress.com&amp;blog=8579687&amp;post=67&amp;subd=promicrosoftcrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following function when called gets the GUID of current user</p>
<p><pre class="brush: xml;">

//

// Name : GetCurrentUserId

// Description: Gets the id of the current user

// Parameters : none

// Return Value: Guid of the current user

// Usage : var userId = GetCurrentUserId();

//

function GetCurrentUserId()

{

var xmlhttp = new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;);

xmlhttp.open(&quot;POST&quot;, &quot;/mscrmservices/2007/crmservice.asmx&quot;, false);

xmlhttp.setRequestHeader(&quot;Content-Type&quot;, &quot;text/xml; charset=utf-8&quot;);

xmlhttp.setRequestHeader(&quot;SOAPAction&quot;, &quot;&lt;a href=&quot;http://schemas.microsoft.com/crm/2007/WebServices/Execute&quot;&quot;&gt;http://schemas.microsoft.com/crm/2007/WebServices/Execute&quot;&lt;/a&gt;);

var soapBody = &quot;&lt;soap:Body&gt;&quot;+

&quot;&lt;Execute xmlns='&lt;a href=&quot;http://schemas.microsoft.com/crm/2007/WebServices&quot;&gt;http://schemas.microsoft.com/crm/2007/WebServices&lt;/a&gt;'&gt;&quot;+

&quot;&lt;Request xsi:type='WhoAmIRequest' /&gt;&quot;+

&quot;&lt;/Execute&gt;&lt;/soap:Body&gt;&quot;;

var soapXml = &quot;&lt;soap:Envelope &quot; +

&quot;xmlns:soap='&lt;a href=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;http://schemas.xmlsoap.org/soap/envelope/&lt;/a&gt;' &quot;+

&quot;xmlns:xsi='&lt;a href=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/a&gt;' &quot;+

&quot;xmlns:xsd='&lt;a href=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;http://www.w3.org/2001/XMLSchema&lt;/a&gt;'&gt;&quot;;

soapXml += GenerateAuthenticationHeader();

soapXml += soapBody;

soapXml += &quot;&lt;/soap:Envelope&gt;&quot;;

xmlhttp.send(soapXml);

xmlDoc=new ActiveXObject(&quot;Microsoft.XMLDOM&quot;);

xmlDoc.async=false;

xmlDoc.loadXML(xmlhttp.responseXML.xml);

var userid = xmlDoc.getElementsByTagName(&quot;UserId&quot;)[0].childNodes[0].nodeValue;

return userid;

}

</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/promicrosoftcrm.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/promicrosoftcrm.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/promicrosoftcrm.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/promicrosoftcrm.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/promicrosoftcrm.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/promicrosoftcrm.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/promicrosoftcrm.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/promicrosoftcrm.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/promicrosoftcrm.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/promicrosoftcrm.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/promicrosoftcrm.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/promicrosoftcrm.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/promicrosoftcrm.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/promicrosoftcrm.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=promicrosoftcrm.wordpress.com&amp;blog=8579687&amp;post=67&amp;subd=promicrosoftcrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://promicrosoftcrm.wordpress.com/2009/11/18/javascript-to-get-current-user-id/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/859a3f2505968b1ba7addfd46b14a50f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">CRM</media:title>
		</media:content>
	</item>
		<item>
		<title>Javascript to check if user has a particular role-Field Level Security in CRM</title>
		<link>http://promicrosoftcrm.wordpress.com/2009/11/18/javascript-to-check-if-user-has-a-particular-role-field-level-security-in-crm/</link>
		<comments>http://promicrosoftcrm.wordpress.com/2009/11/18/javascript-to-check-if-user-has-a-particular-role-field-level-security-in-crm/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 01:04:55 +0000</pubDate>
		<dc:creator>CRM</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://promicrosoftcrm.wordpress.com/2009/11/18/javascript-to-check-if-user-has-a-particular-role-field-level-security-in-crm/</guid>
		<description><![CDATA[Call the following function to check if the user has a particular role; Based in the value of UserHasRole function you can set the security at field level You need to copy the following two functions to work<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=promicrosoftcrm.wordpress.com&amp;blog=8579687&amp;post=66&amp;subd=promicrosoftcrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Call the following function to check if the user has a particular role;</p>
<p>Based in the value of UserHasRole function you can set the security at field level</p>
<p><pre class="brush: jscript;">

UserHasRole(GetCurrentUserRoles(), &quot;System Administrator&quot;);

</pre></p>
<p>You need to copy the following two functions to work</p>
<p><pre class="brush: jscript;">

//

// Name : UserHasRole

// Description: check if a role exist in the list of security roles (XML) user has

// Parameters : oXml

// resultXML you retrieve from GetCurrentUserRoles()

// role

// string value of the security role you want to check against

// Return Value: true if security role exists, otherwise false;

// Usage : var isUserSA = UserHasRole(resultXml, &quot;System Administrator&quot;);

//

function UserHasRole(oXml, role)

{

if(oXml != null)

{

//select the node text

var roles = oXml.selectNodes(&quot;//BusinessEntity/q1:name&quot;);

if(roles != null)

{

for(i = 0; i &lt; roles.length; i++)

{

if(roles[i].text == role)

{

//return true if user has this role

return true;

}

}

}

}

//otherwise return false

return false;

}

</pre></p>
<p><pre class="brush: jscript;">

//

// Name : GetCurrentUserRoles

// Description: Get all the security roles the current user is in

// Parameters : None

// Return Value: result XML from web service call

// Usage : var resultXml = GetCurrentUserRoles();

//

function GetCurrentUserRoles()

{

var xml = &quot;&quot; +

&quot;&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&quot; +

&quot;&lt;soap:Envelope xmlns:soap=&quot;&lt;a href=&quot;http://schemas.xmlsoap.org/soap/envelope/%5C&quot;&quot;&gt;http://schemas.xmlsoap.org/soap/envelope/&quot;&lt;/a&gt; xmlns:xsi=&quot;&lt;a href=&quot;http://www.w3.org/2001/XMLSchema-instance%5C&quot;&quot;&gt;http://www.w3.org/2001/XMLSchema-instance&quot;&lt;/a&gt; xmlns:xsd=&quot;&lt;a href=&quot;http://www.w3.org/2001/XMLSchema%5C&quot;&gt;&quot;&quot;&gt;http://www.w3.org/2001/XMLSchema&quot;&gt;&quot;&lt;/a&gt; + GenerateAuthenticationHeader() +

&quot; &lt;soap:Body&gt;&quot; +

&quot; &lt;RetrieveMultiple xmlns=&quot;&lt;a href=&quot;http://schemas.microsoft.com/crm/2007/WebServices%5C&quot;&gt;&quot;&quot;&gt;http://schemas.microsoft.com/crm/2007/WebServices&quot;&gt;&quot;&lt;/a&gt; +

&quot; &lt;query xmlns:q1=&quot;&lt;a href=&quot;http://schemas.microsoft.com/crm/2006/Query%5C&quot;&quot;&gt;http://schemas.microsoft.com/crm/2006/Query&quot;&lt;/a&gt; xsi:type=&quot;q1:QueryExpression&quot;&gt;&quot; +

&quot; &lt;q1:EntityName&gt;role&lt;/q1:EntityName&gt;&quot; +

&quot; &lt;q1:ColumnSet xsi:type=&quot;q1:ColumnSet&quot;&gt;&quot; +

&quot; &lt;q1:Attributes&gt;&quot; +

&quot; &lt;q1:Attribute&gt;name&lt;/q1:Attribute&gt;&quot; +

&quot; &lt;/q1:Attributes&gt;&quot; +

&quot; &lt;/q1:ColumnSet&gt;&quot; +

&quot; &lt;q1:Distinct&gt;false&lt;/q1:Distinct&gt;&quot; +

&quot; &lt;q1:LinkEntities&gt;&quot; +

&quot; &lt;q1:LinkEntity&gt;&quot; +

&quot; &lt;q1:LinkFromAttributeName&gt;roleid&lt;/q1:LinkFromAttributeName&gt;&quot; +

&quot; &lt;q1:LinkFromEntityName&gt;role&lt;/q1:LinkFromEntityName&gt;&quot; +

&quot; &lt;q1:LinkToEntityName&gt;systemuserroles&lt;/q1:LinkToEntityName&gt;&quot; +

&quot; &lt;q1:LinkToAttributeName&gt;roleid&lt;/q1:LinkToAttributeName&gt;&quot; +

&quot; &lt;q1:JoinOperator&gt;Inner&lt;/q1:JoinOperator&gt;&quot; +

&quot; &lt;q1:LinkEntities&gt;&quot; +

&quot; &lt;q1:LinkEntity&gt;&quot; +

&quot; &lt;q1:LinkFromAttributeName&gt;systemuserid&lt;/q1:LinkFromAttributeName&gt;&quot; +

&quot; &lt;q1:LinkFromEntityName&gt;systemuserroles&lt;/q1:LinkFromEntityName&gt;&quot; +

&quot; &lt;q1:LinkToEntityName&gt;systemuser&lt;/q1:LinkToEntityName&gt;&quot; +

&quot; &lt;q1:LinkToAttributeName&gt;systemuserid&lt;/q1:LinkToAttributeName&gt;&quot; +

&quot; &lt;q1:JoinOperator&gt;Inner&lt;/q1:JoinOperator&gt;&quot; +

&quot; &lt;q1:LinkCriteria&gt;&quot; +

&quot; &lt;q1:FilterOperator&gt;And&lt;/q1:FilterOperator&gt;&quot; +

&quot; &lt;q1:Conditions&gt;&quot; +

&quot; &lt;q1:Condition&gt;&quot; +

&quot; &lt;q1:AttributeName&gt;systemuserid&lt;/q1:AttributeName&gt;&quot; +

&quot; &lt;q1:Operator&gt;EqualUserId&lt;/q1:Operator&gt;&quot; +

&quot; &lt;/q1:Condition&gt;&quot; +

&quot; &lt;/q1:Conditions&gt;&quot; +

&quot; &lt;/q1:LinkCriteria&gt;&quot; +

&quot; &lt;/q1:LinkEntity&gt;&quot; +

&quot; &lt;/q1:LinkEntities&gt;&quot; +

&quot; &lt;/q1:LinkEntity&gt;&quot; +

&quot; &lt;/q1:LinkEntities&gt;&quot; +

&quot; &lt;/query&gt;&quot; +

&quot; &lt;/RetrieveMultiple&gt;&quot; +

&quot; &lt;/soap:Body&gt;&quot; +

&quot;&lt;/soap:Envelope&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; &lt;a href=&quot;http://schemas.microsoft.com/crm/2007/WebServices/RetrieveMultiple&quot;&quot;&gt;http://schemas.microsoft.com/crm/2007/WebServices/RetrieveMultiple&quot;&lt;/a&gt;);

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;

return(resultXml);

}

</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/promicrosoftcrm.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/promicrosoftcrm.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/promicrosoftcrm.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/promicrosoftcrm.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/promicrosoftcrm.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/promicrosoftcrm.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/promicrosoftcrm.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/promicrosoftcrm.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/promicrosoftcrm.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/promicrosoftcrm.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/promicrosoftcrm.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/promicrosoftcrm.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/promicrosoftcrm.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/promicrosoftcrm.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=promicrosoftcrm.wordpress.com&amp;blog=8579687&amp;post=66&amp;subd=promicrosoftcrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://promicrosoftcrm.wordpress.com/2009/11/18/javascript-to-check-if-user-has-a-particular-role-field-level-security-in-crm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/859a3f2505968b1ba7addfd46b14a50f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">CRM</media:title>
		</media:content>
	</item>
		<item>
		<title>How to force submit readonly field in CRM 4</title>
		<link>http://promicrosoftcrm.wordpress.com/2009/11/17/how-to-force-submit-readonly-field-in-crm-4/</link>
		<comments>http://promicrosoftcrm.wordpress.com/2009/11/17/how-to-force-submit-readonly-field-in-crm-4/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 23:36:10 +0000</pubDate>
		<dc:creator>CRM</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Fields]]></category>

		<guid isPermaLink="false">http://promicrosoftcrm.wordpress.com/2009/11/17/how-to-force-submit-readonly-field-in-crm-4/</guid>
		<description><![CDATA[new_name is a readonly field so have to force submit to save changes<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=promicrosoftcrm.wordpress.com&amp;blog=8579687&amp;post=62&amp;subd=promicrosoftcrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>new_name is a readonly field so have to force submit to save changes</p>
<p><pre class="brush: jscript;">

crmForm.all.new_name.ForceSubmit = true;

</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/promicrosoftcrm.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/promicrosoftcrm.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/promicrosoftcrm.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/promicrosoftcrm.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/promicrosoftcrm.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/promicrosoftcrm.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/promicrosoftcrm.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/promicrosoftcrm.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/promicrosoftcrm.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/promicrosoftcrm.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/promicrosoftcrm.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/promicrosoftcrm.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/promicrosoftcrm.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/promicrosoftcrm.wordpress.com/62/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=promicrosoftcrm.wordpress.com&amp;blog=8579687&amp;post=62&amp;subd=promicrosoftcrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://promicrosoftcrm.wordpress.com/2009/11/17/how-to-force-submit-readonly-field-in-crm-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/859a3f2505968b1ba7addfd46b14a50f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">CRM</media:title>
		</media:content>
	</item>
		<item>
		<title>Retrieve value of an Attribute from an Entity</title>
		<link>http://promicrosoftcrm.wordpress.com/2009/11/17/retrieve-value-of-an-attribute-from-an-entity/</link>
		<comments>http://promicrosoftcrm.wordpress.com/2009/11/17/retrieve-value-of-an-attribute-from-an-entity/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 23:01:20 +0000</pubDate>
		<dc:creator>CRM</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Fetch]]></category>

		<guid isPermaLink="false">http://promicrosoftcrm.wordpress.com/2009/11/17/retrieve-value-of-an-attribute-from-an-entity/</guid>
		<description><![CDATA[The following function retrieves value of an attribute/Field from an entity<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=promicrosoftcrm.wordpress.com&amp;blog=8579687&amp;post=55&amp;subd=promicrosoftcrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following function retrieves value of an attribute/Field from an entity</p>
<p><pre class="brush: xml;">
function RetrieveNameFromEntityRecord(entityName, attributeName, id)
{
   var xml = &amp;quot;&amp;lt;?xml version='1.0' encoding='utf-8'?&amp;gt;&amp;quot;+ 
    &amp;quot;&amp;lt;soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'&amp;quot;+
    &amp;quot; xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'&amp;quot;+
    &amp;quot; xmlns:xsd='http://www.w3.org/2001/XMLSchema'&amp;gt;&amp;quot;+ 
    GenerateAuthenticationHeader()+ 
    &amp;quot;&amp;lt;soap:Body&amp;gt;&amp;quot;+ 
    &amp;quot;&amp;lt;Retrieve xmlns='http://schemas.microsoft.com/crm/2007/WebServices'&amp;gt;&amp;quot;+ 
    &amp;quot;&amp;lt;entityName&amp;gt;&amp;quot; + entityName + &amp;quot;&amp;lt;/entityName&amp;gt;&amp;quot;+ 
    &amp;quot;&amp;lt;id&amp;gt;&amp;quot;+ id+&amp;quot;&amp;lt;/id&amp;gt;&amp;quot;+ 
    &amp;quot;&amp;lt;columnSet xmlns:q1='http://schemas.microsoft.com/crm/2006/Query' xsi:type='q1:ColumnSet'&amp;gt;&amp;quot;+ 
    &amp;quot;&amp;lt;q1:Attributes&amp;gt;&amp;quot;+ 
    &amp;quot;&amp;lt;q1:Attribute&amp;gt;&amp;quot; + attributeName + &amp;quot;&amp;lt;/q1:Attribute&amp;gt;&amp;quot;+ 
    &amp;quot;&amp;lt;/q1:Attributes&amp;gt;&amp;quot;+ 
    &amp;quot;&amp;lt;/columnSet&amp;gt;&amp;quot;+ 
    &amp;quot;&amp;lt;/Retrieve&amp;gt;&amp;quot;+ 
    &amp;quot;&amp;lt;/soap:Body&amp;gt;&amp;quot;+ 
    &amp;quot;&amp;lt;/soap:Envelope&amp;gt;&amp;quot;;
    // Prepare the xmlHttpObject and send the request.
  var xHReq = new ActiveXObject(&amp;quot;Msxml2.XMLHTTP&amp;quot;);
  xHReq.Open(&amp;quot;POST&amp;quot;, &amp;quot;/mscrmservices/2007/CrmService.asmx&amp;quot;, false);
  xHReq.setRequestHeader     (&amp;quot;SOAPAction&amp;quot;,&amp;quot;http://schemas.microsoft.com/crm/2007/WebServices/Retrieve&amp;quot;);
  xHReq.setRequestHeader(&amp;quot;Content-Type&amp;quot;, &amp;quot;text/xml; charset=utf-8&amp;quot;);
  xHReq.setRequestHeader(&amp;quot;Content-Length&amp;quot;, xml.length);
  xHReq.send(xml);
  // Capture the result.
  var resultXml = xHReq.responseXML;

  var errorCount = resultXml.selectNodes('//error').length;
  if (errorCount != 0)
  {
     var msg = resultXml.selectSingleNode('//description').nodeTypedValue;
     alert(msg);
  }
  else
  {
    return resultXml.selectSingleNode(&amp;quot;//q1:&amp;quot; + attributeName).nodeTypedValue;
  } 
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/promicrosoftcrm.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/promicrosoftcrm.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/promicrosoftcrm.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/promicrosoftcrm.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/promicrosoftcrm.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/promicrosoftcrm.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/promicrosoftcrm.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/promicrosoftcrm.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/promicrosoftcrm.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/promicrosoftcrm.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/promicrosoftcrm.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/promicrosoftcrm.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/promicrosoftcrm.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/promicrosoftcrm.wordpress.com/55/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=promicrosoftcrm.wordpress.com&amp;blog=8579687&amp;post=55&amp;subd=promicrosoftcrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://promicrosoftcrm.wordpress.com/2009/11/17/retrieve-value-of-an-attribute-from-an-entity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/859a3f2505968b1ba7addfd46b14a50f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">CRM</media:title>
		</media:content>
	</item>
		<item>
		<title>How to rename a title of a section using javascript for CRM 4.0</title>
		<link>http://promicrosoftcrm.wordpress.com/2009/11/17/how-to-rename-a-title-of-a-section-using-javascript-for-crm-4-0/</link>
		<comments>http://promicrosoftcrm.wordpress.com/2009/11/17/how-to-rename-a-title-of-a-section-using-javascript-for-crm-4-0/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 22:33:01 +0000</pubDate>
		<dc:creator>CRM</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[section]]></category>

		<guid isPermaLink="false">http://promicrosoftcrm.wordpress.com/2009/11/17/how-to-rename-a-title-of-a-section-using-javascript-for-crm-4-0/</guid>
		<description><![CDATA[Call the following function Copy the following two functions This post was originally posted in http://www.irfansaeed.net<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=promicrosoftcrm.wordpress.com&amp;blog=8579687&amp;post=46&amp;subd=promicrosoftcrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Call the following function</p>
<p><pre class="brush: csharp;">

UpdateSectionName(&quot;Tab_Name&quot;,&quot;Section_Name&quot;,&quot;New_Name&quot;)

</pre></p>
<p>Copy the following two functions</p>
<p><pre class="brush: csharp;">


function UpdateSectionName(TabNumber,CurrentSectionName,NewSectionName)
{
 var anchorNode = document.getElementById(TabNumber);
 var secBarCss  = &quot;ms-crm-Form-SectionBar&quot;;
 var addrSecElm = null;

 var results = getElementsByClassName( secBarCss , anchorNode );
 for( var i = 0 ; i &lt; results.length ; i++ )
 {
 if( results[i].innerText == CurrentSectionName)
 {
 addrSecElm = results[i];
 break;
 }
 }
 if(addrSecElm != null)
 {
 addrSecElm.innerText = NewSectionName;
 }
}


</pre></p>
<p><pre class="brush: csharp;">


function getElementsByClassName(className, anchorNode)
{
 if(!anchorNode) anchorNode = document.body;
 var result = [];
 var regEx  = new RegExp(&quot;\\b&quot; + className + &quot;\\b&quot;);
 var children = anchorNode.getElementsByTagName(&quot;*&quot;);
 for( var i = 0 ; i &lt; children.length ; i++ )
 {
 if( regEx.test( children[i].className ) )
 result.push( children[i] );
 }
 return result;
}

</pre></p>
<p>This post was originally posted in http://www.irfansaeed.net</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/promicrosoftcrm.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/promicrosoftcrm.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/promicrosoftcrm.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/promicrosoftcrm.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/promicrosoftcrm.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/promicrosoftcrm.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/promicrosoftcrm.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/promicrosoftcrm.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/promicrosoftcrm.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/promicrosoftcrm.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/promicrosoftcrm.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/promicrosoftcrm.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/promicrosoftcrm.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/promicrosoftcrm.wordpress.com/46/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=promicrosoftcrm.wordpress.com&amp;blog=8579687&amp;post=46&amp;subd=promicrosoftcrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://promicrosoftcrm.wordpress.com/2009/11/17/how-to-rename-a-title-of-a-section-using-javascript-for-crm-4-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/859a3f2505968b1ba7addfd46b14a50f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">CRM</media:title>
		</media:content>
	</item>
		<item>
		<title>Timeout exception in data migration</title>
		<link>http://promicrosoftcrm.wordpress.com/2009/10/27/timeout-exception-in-data-migration/</link>
		<comments>http://promicrosoftcrm.wordpress.com/2009/10/27/timeout-exception-in-data-migration/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 05:35:31 +0000</pubDate>
		<dc:creator>CRM</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Data Migration]]></category>

		<guid isPermaLink="false">http://promicrosoftcrm.wordpress.com/2009/10/27/timeout-exception-in-data-migration/</guid>
		<description><![CDATA[When there are no ports available for data transfer that’s when we get the timeout exception, change the following values(TcpTimedWaitDelay and MaxUserPort) , and restart the server to make the changes effect. HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters On the Edit menu, click New, and then add the following registry entry: Value Name: MaxUserPort Value Type: DWORD Value data: 65534 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=promicrosoftcrm.wordpress.com&amp;blog=8579687&amp;post=45&amp;subd=promicrosoftcrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em>When there are no ports available for data transfer that’s when we get the timeout exception, change the following values(TcpTimedWaitDelay and MaxUserPort)</em></p>
<p><em>, and restart the server to make the changes effect.</em></p>
<p><em>HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters </em></p>
<p><em>On the Edit menu, click New, and then add the following registry entry:<br />
Value Name: MaxUserPort<br />
Value Type: DWORD<br />
Value data: 65534<br />
Valid Range: 5000-65534 (decimal)<br />
Default: 0&#215;1388 (5000 decimal</em>)</p>
<p>We need to increase the value to a higher one eg 65534.</p>
<p>Another fix for a lot of time_wait is adjusting the TcpTimedwaitDelay in the registry. This value indicates the amount of time a port will remain in Time_wait state if you do not close the connection. If you decrease this value, the port will be in time_wait state for less amount of time and will be reused sooner.</p>
<p>This key is located at -:</p>
<p><em>HKEY_LOCAL_MACHINESystemCurrectControlSetservicesTcpipParameters<br />
</em>The registry value is:</p>
<p><em>TcpTimedWaitDelay </em></p>
<p><em>Key: TcpipParameters<br />
Value Type: REG_DWORD &#8211; Time in seconds<br />
Valid Range: 30-300 (decimal)<br />
Default: 0xF0 (240 decimal)</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/promicrosoftcrm.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/promicrosoftcrm.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/promicrosoftcrm.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/promicrosoftcrm.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/promicrosoftcrm.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/promicrosoftcrm.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/promicrosoftcrm.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/promicrosoftcrm.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/promicrosoftcrm.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/promicrosoftcrm.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/promicrosoftcrm.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/promicrosoftcrm.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/promicrosoftcrm.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/promicrosoftcrm.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=promicrosoftcrm.wordpress.com&amp;blog=8579687&amp;post=45&amp;subd=promicrosoftcrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://promicrosoftcrm.wordpress.com/2009/10/27/timeout-exception-in-data-migration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/859a3f2505968b1ba7addfd46b14a50f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">CRM</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Make a Field required in crm form by javascript</title>
		<link>http://promicrosoftcrm.wordpress.com/2009/10/22/how-to-make-a-field-required-in-crm-form-by-javascript/</link>
		<comments>http://promicrosoftcrm.wordpress.com/2009/10/22/how-to-make-a-field-required-in-crm-form-by-javascript/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 22:33:12 +0000</pubDate>
		<dc:creator>CRM</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Field]]></category>

		<guid isPermaLink="false">http://promicrosoftcrm.wordpress.com/2009/10/22/how-to-make-a-field-required-in-crm-form-by-javascript/</guid>
		<description><![CDATA[Here is the Jscript code to make a field required / not required. Replace the new_fieldname with whatever the name of your field is. 1 = Required 0 = Not required<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=promicrosoftcrm.wordpress.com&amp;blog=8579687&amp;post=28&amp;subd=promicrosoftcrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is the Jscript code to make a field required / not required. Replace the <span style="color:#0000ff;">new_fieldname</span> with whatever the name of your field is.</p>
<p><pre class="brush: csharp;">
crmForm.SetFieldReqLevel(&amp;quot;new_fieldname&amp;quot;, 1);
</pre></p>
<p><strong>1 = Required</strong></p>
<p><strong>0 = Not required</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/promicrosoftcrm.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/promicrosoftcrm.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/promicrosoftcrm.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/promicrosoftcrm.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/promicrosoftcrm.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/promicrosoftcrm.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/promicrosoftcrm.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/promicrosoftcrm.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/promicrosoftcrm.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/promicrosoftcrm.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/promicrosoftcrm.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/promicrosoftcrm.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/promicrosoftcrm.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/promicrosoftcrm.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=promicrosoftcrm.wordpress.com&amp;blog=8579687&amp;post=28&amp;subd=promicrosoftcrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://promicrosoftcrm.wordpress.com/2009/10/22/how-to-make-a-field-required-in-crm-form-by-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/859a3f2505968b1ba7addfd46b14a50f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">CRM</media:title>
		</media:content>
	</item>
		<item>
		<title>Migrating and uploading resolutions in CRM</title>
		<link>http://promicrosoftcrm.wordpress.com/2009/08/04/code-for-uploading-resolutions/</link>
		<comments>http://promicrosoftcrm.wordpress.com/2009/08/04/code-for-uploading-resolutions/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 01:20:04 +0000</pubDate>
		<dc:creator>CRM</dc:creator>
				<category><![CDATA[Data Migration]]></category>

		<guid isPermaLink="false">http://promicrosoftcrm.wordpress.com/2009/08/04/code-for-uploading-resolutions/</guid>
		<description><![CDATA[The following is the code for inserting resolution Here is the code for inserting case resolutions using code. Key is first insert as many resolutions as you need and then call the Case Close message.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=promicrosoftcrm.wordpress.com&amp;blog=8579687&amp;post=12&amp;subd=promicrosoftcrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following is the code for inserting resolution</p>
<p>Here is the code for inserting case resolutions using code. Key is first insert as many resolutions as you need and then call the Case Close message.</p>
<p><pre class="brush: csharp;">

public Form1()

{

InitializeComponent();

string crmServerUrl = &amp;quot;&amp;lt;a href=&amp;quot;http://localhost:5555/&amp;amp;quot;;&amp;quot;&amp;gt;http://localhost:5555/&amp;quot;;&amp;lt;/a&amp;gt;

CrmAuthenticationToken token = new CrmAuthenticationToken();

//TODO:: Fix later for test

token.OrganizationName = &amp;quot;CompanyName&amp;quot;;

CrmService service = new CrmService();

if (crmServerUrl != null &amp;amp;&amp;amp;

crmServerUrl.Length &amp;gt; 0)

{

UriBuilder builder = new UriBuilder(crmServerUrl);

builder.Path = &amp;quot;//MSCRMServices//2007//CrmService.asmx&amp;quot;;

service.Url = builder.Uri.ToString();

}

service.Credentials = System.Net.CredentialCache.DefaultCredentials;

service.CrmAuthenticationTokenValue = token;

string incidentID = &amp;quot;A070ADF5-E874-DE11-BF68-0003FF9BCAF0&amp;quot;;

//string noteStr = &amp;quot;This is the sample text to be inserted.&amp;quot;;

//DateTime createdDate = new DateTime(2009,01,21);

//CreateCRMNotes(service, incidentID, noteStr,createdDate);

string resolutionString = &amp;quot;SDK resolve&amp;quot;;

CreateResolution(service, incidentID, resolutionString);

}

public void CreateResolution(CrmService service, string incidentID, string noteStr)

{

TargetCreateIncidentResolution resolution = new TargetCreateIncidentResolution();

incidentresolution resolve = new incidentresolution();

resolve.timespent = new CrmNumber(20);

Lookup incident = new Lookup(EntityName.incident.ToString(),new Guid(incidentID));

resolve.incidentid = incident;

resolve.description = noteStr;

Status status = new Status(2);

resolve.statuscode = status;

IncidentResolutionStateInfo state = new IncidentResolutionStateInfo();

state.Value = IncidentResolutionState.Completed;

resolve.statecode = state;

resolve.subject = &amp;quot;some garbage&amp;quot;;

resolution.IncidentResolution = resolve;

CreateRequest create = new CreateRequest();

create.Target = resolution;

// Execute the request.

CreateResponse created = (CreateResponse)service.Execute(create);

//resolutionID = created.id;

//Call this once you have all the resolutions inserted

CloseIncidentRequest StatusChange = new CloseIncidentRequest();

StatusChange.IncidentResolution = resolve;

StatusChange.Status = 5;

//Primary key of record

// StatusChange.Entity.Id = new Guid(incidentID);

//StatusChange.Entity.Name = &amp;quot;incident&amp;quot;;

//StatusChange.State = &amp;quot;Resolved&amp;quot;;

//StatusChange.Status = 200003;

service.Execute(StatusChange);

}

</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/promicrosoftcrm.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/promicrosoftcrm.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/promicrosoftcrm.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/promicrosoftcrm.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/promicrosoftcrm.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/promicrosoftcrm.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/promicrosoftcrm.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/promicrosoftcrm.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/promicrosoftcrm.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/promicrosoftcrm.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/promicrosoftcrm.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/promicrosoftcrm.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/promicrosoftcrm.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/promicrosoftcrm.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=promicrosoftcrm.wordpress.com&amp;blog=8579687&amp;post=12&amp;subd=promicrosoftcrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://promicrosoftcrm.wordpress.com/2009/08/04/code-for-uploading-resolutions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/859a3f2505968b1ba7addfd46b14a50f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">CRM</media:title>
		</media:content>
	</item>
		<item>
		<title>0x80042f09 SecLib::CheckPrivilege failed. Returned hr = -2147209463, User: 529cc8c0-23b6-dd11-a373-001cc458db68</title>
		<link>http://promicrosoftcrm.wordpress.com/2009/07/31/0x80042f09-seclibcheckprivilege-failed-returned-hr-2147209463-user-529cc8c0-23b6-dd11-a373-001cc458db68/</link>
		<comments>http://promicrosoftcrm.wordpress.com/2009/07/31/0x80042f09-seclibcheckprivilege-failed-returned-hr-2147209463-user-529cc8c0-23b6-dd11-a373-001cc458db68/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 01:29:12 +0000</pubDate>
		<dc:creator>CRM</dc:creator>
				<category><![CDATA[error]]></category>

		<guid isPermaLink="false">http://promicrosoftcrm.wordpress.com/2009/07/31/0x80042f09-seclibcheckprivilege-failed-returned-hr-2147209463-user-529cc8c0-23b6-dd11-a373-001cc458db68/</guid>
		<description><![CDATA[Check User roles as this error represent error in roles of user<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=promicrosoftcrm.wordpress.com&amp;blog=8579687&amp;post=11&amp;subd=promicrosoftcrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Check User roles as this error represent error in roles of user</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/promicrosoftcrm.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/promicrosoftcrm.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/promicrosoftcrm.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/promicrosoftcrm.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/promicrosoftcrm.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/promicrosoftcrm.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/promicrosoftcrm.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/promicrosoftcrm.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/promicrosoftcrm.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/promicrosoftcrm.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/promicrosoftcrm.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/promicrosoftcrm.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/promicrosoftcrm.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/promicrosoftcrm.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=promicrosoftcrm.wordpress.com&amp;blog=8579687&amp;post=11&amp;subd=promicrosoftcrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://promicrosoftcrm.wordpress.com/2009/07/31/0x80042f09-seclibcheckprivilege-failed-returned-hr-2147209463-user-529cc8c0-23b6-dd11-a373-001cc458db68/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/859a3f2505968b1ba7addfd46b14a50f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">CRM</media:title>
		</media:content>
	</item>
		<item>
		<title>How to migrate Notes Data with Datetime</title>
		<link>http://promicrosoftcrm.wordpress.com/2009/07/29/how-to-migrate-notes-data-with-datetime/</link>
		<comments>http://promicrosoftcrm.wordpress.com/2009/07/29/how-to-migrate-notes-data-with-datetime/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 05:56:30 +0000</pubDate>
		<dc:creator>CRM</dc:creator>
				<category><![CDATA[Data Migration]]></category>

		<guid isPermaLink="false">http://promicrosoftcrm.wordpress.com/2009/07/29/how-to-migrate-notes-data-with-datetime/</guid>
		<description><![CDATA[Method to create service and migrate the notes data<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=promicrosoftcrm.wordpress.com&amp;blog=8579687&amp;post=10&amp;subd=promicrosoftcrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Method to create service and migrate the notes data</p>
<p><pre class="brush: csharp;">

Public void MigrateNotes

{

string crmServerUrl = &amp;quot;&amp;lt;a href=&amp;quot;http://localhost:5555/&amp;amp;quot;&amp;quot;&amp;gt;http://localhost:5555/&amp;quot;&amp;lt;/a&amp;gt;;

CrmAuthenticationToken token = new CrmAuthenticationToken();

token.OrganizationName = &amp;quot;CompanyName&amp;quot;;

CrmService service = new CrmService();

if (crmServerUrl != null &amp;amp;&amp;amp;

crmServerUrl.Length &amp;gt; 0)

{

UriBuilder builder = new UriBuilder(crmServerUrl);

builder.Path = &amp;quot;//MSCRMServices//2007//CrmService.asmx&amp;quot;;

service.Url = builder.Uri.ToString();

}

service.Credentials = System.Net.CredentialCache.DefaultCredentials;

service.CrmAuthenticationTokenValue = token;

string incidentID = &amp;quot;40B3A02A-D440-DE11-A415-0003FFB76206&amp;quot;;

string noteStr = &amp;quot;This is the sample text to be inserted.&amp;quot;;

DateTime createdDate = new DateTime(2009,01,21);

CreateCRMNotes(service, incidentID, noteStr,createdDate);

}

Now create a method to insert notes into CRM

public void CreateCRMNotes(CrmService service, string incidentID, string noteStr,DateTime createdDt)

{

annotation oNote = new annotation();

oNote.notetext = noteStr;

oNote.objectid = new Lookup();

oNote.objectid.type = EntityName.incident.ToString();

oNote.objectid.Value = new Guid(incidentID);

oNote.objecttypecode = new EntityNameReference();

oNote.objecttypecode.Value = EntityName.incident.ToString();

oNote.subject = &amp;quot;Note Created on:&amp;quot; + createdDt.ToShortDateString();

//CrmDateTime createdDate = new CrmDateTime(&amp;quot;createdon&amp;quot;,createdDate.date

CrmDateTime crmCreatedNotes = new CrmDateTime();

crmCreatedNotes.date = createdDt.ToShortDateString();

oNote.createdon = crmCreatedNotes;

TargetCreateAnnotation targetCreate = new TargetCreateAnnotation();

targetCreate.Annotation = oNote;

// Create the request object.

CreateRequest create = new CreateRequest();

create.Target = targetCreate;

// Execute the request.

CreateResponse created = (CreateResponse)service.Execute(create);

//NoteID = created.id;

// return NoteID; }

</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/promicrosoftcrm.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/promicrosoftcrm.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/promicrosoftcrm.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/promicrosoftcrm.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/promicrosoftcrm.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/promicrosoftcrm.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/promicrosoftcrm.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/promicrosoftcrm.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/promicrosoftcrm.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/promicrosoftcrm.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/promicrosoftcrm.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/promicrosoftcrm.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/promicrosoftcrm.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/promicrosoftcrm.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=promicrosoftcrm.wordpress.com&amp;blog=8579687&amp;post=10&amp;subd=promicrosoftcrm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://promicrosoftcrm.wordpress.com/2009/07/29/how-to-migrate-notes-data-with-datetime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/859a3f2505968b1ba7addfd46b14a50f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">CRM</media:title>
		</media:content>
	</item>
	</channel>
</rss>
