<?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>Mohamed Ibrahim Mostafa&#039;s Blog</title>
	<atom:link href="http://www.mohamedibrahim.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mohamedibrahim.net/blog</link>
	<description>Technical issues, problems, errors, findings &#38; resolutions covering Microsoft Dynamics CRM, software development, Microsoft .NET, C#, VB.NET, Commerce Server, Integration, E-Commerce, Scribe, Online shops and more general technology and consultancy posts.</description>
	<lastBuildDate>Mon, 19 Jul 2010 10:48:53 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>What&#8217;s new in Microsoft Dynamics CRM 5 &#8211; Microsoft Dynamics CRM 5 Release date &#8211; Introduction and Early look at Dynamics CRM 5</title>
		<link>http://www.mohamedibrahim.net/blog/2010/05/19/whats-new-in-microsoft-dynamics-crm-5-microsoft-dynamics-crm-5-release-date-introduction-and-early-look-at-dynamics-crm-5/</link>
		<comments>http://www.mohamedibrahim.net/blog/2010/05/19/whats-new-in-microsoft-dynamics-crm-5-microsoft-dynamics-crm-5-release-date-introduction-and-early-look-at-dynamics-crm-5/#comments</comments>
		<pubDate>Wed, 19 May 2010 11:53:08 +0000</pubDate>
		<dc:creator>Mohamed Ibrahim Mostafa</dc:creator>
				<category><![CDATA[Microsoft Dynamics CRM]]></category>
		<category><![CDATA[CRM 5]]></category>
		<category><![CDATA[Dynamics CRM 5]]></category>
		<category><![CDATA[Microsoft Dynamics CRM 5]]></category>
		<category><![CDATA[New Release]]></category>
		<category><![CDATA[Release Date]]></category>

		<guid isPermaLink="false">http://www.mohamedibrahim.net/blog/?p=211</guid>
		<description><![CDATA[These are some questions that many people are asking about Microsoft Dynamic CRM 5.
I know my answers below will not satisfy everybody but I promise, once we are allowed to do so, and I&#8217;m relieved from my NDA, I Will post all information about all new features in Microsoft Dynamics CRM 5 with screenshots, show [...]]]></description>
			<content:encoded><![CDATA[<p>These are some questions that many people are asking about Microsoft Dynamic CRM 5.</p>
<p>I know my answers below will not satisfy everybody but I promise, once we are allowed to do so, and I&#8217;m relieved from my NDA, I Will post <strong>all information about all new features in Microsoft Dynamics CRM 5 with screenshots, show cases and demo of the product </strong>- so watch this space. This will hopefully happen when the beta version is released.</p>
<p>Now to the Questions:</p>
<p>* What are the new features and functionality and What&#8217;s new in Microsoft Dynamics CRM 5?</p>
<p>* Microsoft Dynamics CRM 5 Release date &#8211; When will it be released for production or the beta release?</p>
<p> This is what Microsoft has recently announced:</p>
<ul>
<li>The upcoming release will be named Microsoft Dynamics CRM 2011.</li>
<li>Beta will be publicly available in September 2010. You can sign up to be notified of availability of BETA at <a href="http://crm.dynamics.com/crm2011beta" target="_blank">http://crm.dynamics.com/crm2011beta</a>.</li>
<li>CRM Online International Expansion reaches 40 planned markets and 41 languages when it is launched.</li>
<li>Microsoft Dynamics Marketplace expected to launch for CRM solutions in September 2010.</li>
</ul>
<p>* Can we have an early look or introduction to Microsoft Dynamics CRM 5 changes and new features:</p>
<p>I am still covered by Microsoft&#8217;s NDA which prevents me from revealing anything not already made public by Microsoft. Please find below links to some information on Microsoft Dynamics CRM 5 from what Microsoft has made public :</p>
<p>· <a href="http://blogs.msdn.com/b/crm/archive/2010/07/12/introducing-microsoft-dynamics-crm-2011.aspx">http://blogs.msdn.com/b/crm/archive/2010/07/12/introducing-microsoft-dynamics-crm-2011.aspx</a> </p>
<p>· <a href="http://blogs.msdn.com/crm/archive/2008/12/18/an-early-look-at-crm-5.aspx">http://blogs.msdn.com/crm/archive/2008/12/18/an-early-look-at-crm-5.aspx</a></p>
<p>· <a href="http://blogs.msdn.com/girishr/archive/2009/11/21/pdc-phone-company-crm-azure-demo.aspx">http://blogs.msdn.com/girishr/archive/2009/11/21/pdc-phone-company-crm-azure-demo.aspx</a></p>
<p>· <a href="http://microsoftpdc.com/Sessions/PR31">http://microsoftpdc.com/Sessions/PR31</a></p>
<p>· <a href=" http://microsoftpdc.com/Sessions/P09-07">http://microsoftpdc.com/Sessions/P09-07</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mohamedibrahim.net/blog/2010/05/19/whats-new-in-microsoft-dynamics-crm-5-microsoft-dynamics-crm-5-release-date-introduction-and-early-look-at-dynamics-crm-5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Microsoft Dynamics CRM 4 field level validation using javascript regular expression on client side handling the onChange event to validate and check the value and text of a CRM 4.0 field</title>
		<link>http://www.mohamedibrahim.net/blog/2010/04/14/microsoft-dynamics-crm-4-field-level-validation-using-javascript-regular-expression-on-client-side-handling-the-onchange-event-to-validate-and-check-the-value-and-text-of-a-crm-40-field/</link>
		<comments>http://www.mohamedibrahim.net/blog/2010/04/14/microsoft-dynamics-crm-4-field-level-validation-using-javascript-regular-expression-on-client-side-handling-the-onchange-event-to-validate-and-check-the-value-and-text-of-a-crm-40-field/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 01:21:41 +0000</pubDate>
		<dc:creator>Mohamed Ibrahim Mostafa</dc:creator>
				<category><![CDATA[General Development]]></category>
		<category><![CDATA[Microsoft Dynamics CRM]]></category>
		<category><![CDATA[CRM]]></category>
		<category><![CDATA[Dynamics]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://www.mohamedibrahim.net/blog/?p=184</guid>
		<description><![CDATA[Please note that this post is aimed as showing how to use javascript regular expression field level validation in Microsoft Dynamics CRM. The post does not focus on the many ways of getting a regular expression. The example regular expression below is used for explanation only.
If you want to create validation at field level in [...]]]></description>
			<content:encoded><![CDATA[<p>Please note that this post is aimed as showing how to use javascript regular expression field level validation in Microsoft Dynamics CRM. The post does not focus on the many ways of getting a regular expression. The example regular expression below is used for explanation only.</p>
<p>If you want to create validation at field level in Microsoft Dynamics CRM 4 to check the input value and text of a CRM field in an entity form, you can do this using regular expressions written in javascript code that handles the on change (onChange) event of this field at client side.</p>
<p>Below is an example of a regular expression but you might want to use your own regex value or search online for almost unlimited number of regular expressions that do just about anything.</p>
<p>For example, if you want to validate a CRM 4 field so that only a 4 digit year value starting from year 1980 is entered in the field text box, follow the following steps:</p>
<p>- Open the entity customisation form<br />
- select the field you want to validate using javascript regular expression.<br />
- Click on field properties, events tab and then open the onChange event.<br />
- In the onChange event type the following javascript code (script) to handle the event and implement the field level validation:</p>
<pre>//-----------------------------
//Regular expression ensuring a 4 digit year value is input starting from year 1980.
var reDate =/^(([1]{1}[9]{1}[8-9]{1}\d{1})|([2-9]{1}\d{3}))$/</pre>
<pre>//Check if the input value satisfies the regular expression condition
if (document.crmForm.all.new_yearfieldname.value.search(reDate)==-1)
{//if match failed
alert("Please enter a valid year value. Year value must be four digits starting from the year 1980")
crmForm.all.new_yearfieldname.value = '';
}
//-----------------</pre>
<p>Another way of doing this is as follows;</p>
<pre><span style="font-family: Georgia;">//-----------------------------
var regexS = "^(([1]{1}[9]{1}[8-9]{1}\d{1})|([2-9]{1}\d{3}))$"; 
var regex = new RegExp( regexS ); 
var results = regex.exec( crmForm.all.new_yearfieldname.value);
if( results == null )   
{//if match failed
alert("Please enter a valid year value. Year value must be four digits starting from the year 1980")
crmForm.all.new_yearfieldname.value = '';
}
//-----------------------------</span></pre>
<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mohamedibrahim.net/blog/2010/04/14/microsoft-dynamics-crm-4-field-level-validation-using-javascript-regular-expression-on-client-side-handling-the-onchange-event-to-validate-and-check-the-value-and-text-of-a-crm-40-field/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax Update progress screen to block access to form during background server side processes</title>
		<link>http://www.mohamedibrahim.net/blog/2010/04/04/189/</link>
		<comments>http://www.mohamedibrahim.net/blog/2010/04/04/189/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 01:38:21 +0000</pubDate>
		<dc:creator>Mohamed Ibrahim Mostafa</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[General Development]]></category>
		<category><![CDATA[Ajax]]></category>

		<guid isPermaLink="false">http://www.mohamedibrahim.net/blog/?p=189</guid>
		<description><![CDATA[If you are writing an Ajax based .NET web application or web page, there are situations were you might want to block the whole webpage from being accessed while a background or server side process is taking place. So for example if the user clicks submit, you want to make the web page not accessible [...]]]></description>
			<content:encoded><![CDATA[<p>If you are writing an Ajax based .NET web application or web page, there are situations were you might want to block the whole webpage from being accessed while a background or server side process is taking place. So for example if the user clicks submit, you want to make the web page not accessible until the backend server side event handler function finishes and reloads the page.</p>
<p>To do this, you need to do the following:</p>
<p>In the button click event, call the javascript function showprogress (client side &#8211; aspx page code):<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<pre>&lt;asp:Button ID="ApplyFilterButton" runat="server" OnClick="ApplyFilterButton_Click"
OnClientClick="if(Page_ClientValidate())ShowProgress();" Text="Apply Filter"
CssClass="ms-crm-Button" Style="height: 23px" /&gt;</pre>
<p>The show progress function should look something like the following:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<pre>&lt;script type="text/javascript"&gt;
   function ShowProgress() {
document.getElementById('&lt;% Response.Write(PageUpdateProgress.ClientID); %&gt;').style.display = "inline";
        }
&lt;/script&gt;</pre>
<p> The update progress control should look something like this:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<pre>&lt;asp:UpdateProgress ID="PageUpdateProgress" runat="server"
AssociatedUpdatePanelID="PageHiddenPanel" DisplayAfter="50"&gt;
  &lt;ProgressTemplate&gt;
     &lt;div id="progressDiv"
     style="background-position: center center;
     background-image: url(../../Images/progress.gif);
     background-repeat: no-repeat; background-attachment: fixed;
     vertical-align: middle; background-color: #000;
     filter: alpha(opacity=50);"&gt;
            &lt;/div&gt;
            &lt;script type="text/javascript"&gt;
                var targetDiv = document.getElementById("progressDiv");
                targetDiv.style.top = 0;
                targetDiv.style.left = 0;
                targetDiv.style.height = screen.availHeight;
                targetDiv.style.width = screen.availWidth;
            &lt;/script&gt;
        &lt;/ProgressTemplate&gt;
    &lt;/asp:UpdateProgres&gt; </pre>
<p> Hope it helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mohamedibrahim.net/blog/2010/04/04/189/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Click through to CRM records from SSRS custom report for Microsfot Dynamics CRM 4. Linking information on SQL Reporting Services custom CRM reports to Dynamics CRM 4 records and opening them up from within the report.</title>
		<link>http://www.mohamedibrahim.net/blog/2010/03/17/click-through-to-crm-records-from-ssrs-custom-report-for-microsfot-dynamics-crm-4-linking-information-on-sql-reporting-services-custom-crm-reports-to-dynamics-crm-4-records-and-opening-them-up-from-w/</link>
		<comments>http://www.mohamedibrahim.net/blog/2010/03/17/click-through-to-crm-records-from-ssrs-custom-report-for-microsfot-dynamics-crm-4-linking-information-on-sql-reporting-services-custom-crm-reports-to-dynamics-crm-4-records-and-opening-them-up-from-w/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 18:19:34 +0000</pubDate>
		<dc:creator>Mohamed Ibrahim Mostafa</dc:creator>
				<category><![CDATA[Microsoft Dynamics CRM]]></category>
		<category><![CDATA[Microsoft SQL Server]]></category>
		<category><![CDATA[CRM]]></category>
		<category><![CDATA[Expression]]></category>
		<category><![CDATA[Query]]></category>
		<category><![CDATA[Report Server]]></category>
		<category><![CDATA[Reporting Services]]></category>
		<category><![CDATA[SQL query]]></category>

		<guid isPermaLink="false">http://www.mohamedibrahim.net/blog/?p=174</guid>
		<description><![CDATA[Click through to CRM records from SSRS custom report for Microsfot Dynamics CRM 4. Linking information on SQL Reporting Services custom CRM reports to Dynamics CRM 4 records and opening them up from within the report.]]></description>
			<content:encoded><![CDATA[<p>If you are writing a custom report &#8211; SQL Server Reporting Services (SSRS) report for Microsoft Dynamics CRM 4, you might want to add the functionality (sql expression) to click through to a record. This can be applied to some or all information shown on the report, so that if you click on the information text box, you open up the corresponding CRM record in a new window such as: click on sub-account in the sub-accounts list to open this sub-account CRM record, or the same for contact, opportunities and so on.</p>
<p>To do this, right click on the text box in where you will be putting the expression and the value to be clicked on, and click on Texbox properties. On there click on Actions on the left, select last option &#8220;Go to URL&#8221; and in the expression box type the following query expression</p>
<pre>=IIF(IsNothing(Parameters!CRM_URL.Value),system.dbnull.value,Parameters!CRM_URL.Value &amp; "?ID={"&amp;Fields!Accountid.Value.ToString()&amp;"}&amp;OTC=1")
/*Replace "&amp;Fields!Accountid" with the ID of the corresponding record */
/*you want to be open, so contactid, opportunityid or any other custom entity id field*/
/*Also replace OTC value above with the Entity Object type Code (OTC) value*/</pre>
<p>You can get any entities OTC value from the &#8220;EntityView&#8221; view or for the full list of all system entities type codes, read this MSDN article: <a href="http://msdn.microsoft.com/en-us/library/bb887791.aspx">http://msdn.microsoft.com/en-us/library/bb887791.aspx</a>. Obviously you will need to get the OTC value for your custom entities from the &#8220;EntityView&#8221; view from your Dynamics CRM database. You can use a query similar to the following:</p>
<pre>select entitytypecode from entityview where entityname = 'account'</pre>
<p>This sql expression can work with any entity either system (cusomisable) or custom entity.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mohamedibrahim.net/blog/2010/03/17/click-through-to-crm-records-from-ssrs-custom-report-for-microsfot-dynamics-crm-4-linking-information-on-sql-reporting-services-custom-crm-reports-to-dynamics-crm-4-records-and-opening-them-up-from-w/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hide tab in any entity form in Microsoft Dynamics CRM 4 using Javascript in onLoad event of the form.</title>
		<link>http://www.mohamedibrahim.net/blog/2010/03/03/hide-tab-in-any-entity-form-in-microsoft-dynamics-crm-4-using-javascript-in-onload-event-of-the-form/</link>
		<comments>http://www.mohamedibrahim.net/blog/2010/03/03/hide-tab-in-any-entity-form-in-microsoft-dynamics-crm-4-using-javascript-in-onload-event-of-the-form/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 20:03:41 +0000</pubDate>
		<dc:creator>Mohamed Ibrahim Mostafa</dc:creator>
				<category><![CDATA[Microsoft Dynamics CRM]]></category>
		<category><![CDATA[CRM]]></category>
		<category><![CDATA[Custom Entity]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.mohamedibrahim.net/blog/?p=177</guid>
		<description><![CDATA[Hide tab in any entity form in Microsoft Dynamics CRM 4 using Javascript in onLoad event of the form.]]></description>
			<content:encoded><![CDATA[<p>In many cases, you might want to remove one of the tabs of an entity form in Microsoft Dynamics CRM 4. This can be specifically helpful in two cases:</p>
<p>1- If you want to hide and show tabs depending on a picklist value selection such as contact type: Hide Work details if contact is of type internal contact for example</p>
<p>2- If you want to hide the Administration and Notes tab from an entity form while these tabs are locked and cannot be removed from the entity form.</p>
<p>To hide a tab in an entity form, you can use the following Javascript sample script:</p>
<pre>//---------------------------Hide a tab by passing tab name to the function
HideTab('Administration');
//replace "Administration" with your tab name</pre>
<pre>function HideTab (tabText)
{
 var tab = FindTab(tabText);
 if (tab)
 {
  tab.style.display = "none";
 }
}
function FindTab(tabText)
{
 var tabBar = document.getElementById("crmTabBar");
 if (tabBar)
 {
  var tabs = tabBar.childNodes;  

  for (var i = 0, len = tabs.length; i &lt; len; i++)
  {
   var currentTab = tabs[i];
   if (currentTab.innerText === tabText)
   {
    return currentTab;
   }
  }
 }
}
//-----------------end of script--------</pre>
<p>Maxjerin has added a new code suggestion. Maxjerin&#8217;s code hides a tab based on the onChange event of a field on the form. If the primary contact &#8220;name&#8221; field is maxjerin, the tab is displayed. Otherwise the tab is hidden.</p>
<p>I have updated the post to include Maxjerin&#8217;s code &#8211; Thanks Maxjerin:</p>
<p>Here is the code that I used to HIDE/UNHIDE a tab when I wanted to show it for only one particular user and hide for others. The code includes some alert messages just for debugging purpose which you might find useful to understand the code. You may remove them once done.</p>
<p>This section goes into the onChange section of the Primary Contact lookup field</p>
<pre>if (crmForm.all.primarycontactid.DataValue == null )
{
var strTabStatus = TabStatus(‘Profile’);
if ( strTabStatus == ”)
{
alert(“Primary Contact none, hiding the tab”);
HideTab(‘Profile’);
}
}
else if (crmForm.all.primarycontactid.DataValue[0].name == ‘maxjerin’)
{
alert(“Primary Contact p f, unhiding the tab”);
UnHideTab(‘Profile’);
//replace “Administration” with your tab name
}
else if (crmForm.all.primarycontactid.DataValue[0].name != ‘maxjerin’)
{
var strTabStatus = TabStatus(‘Profile’);
if (strTabStatus == ” )
{
alert(“Primary Contact other than maxjerin, Hiding the tab”);
HideTab(‘Profile’);
}
}</pre>
<pre>function HideTab (tabText)
{
var tab = FindTab(tabText);
if (tab)
{
tab.style.display = “none”;
}
}</pre>
<pre>function UnHideTab (tabText)
{
var tab = FindTab(tabText);
if (tab)
{
tab.style.display = “”;
}
}</pre>
<pre>function FindTab(tabText)
{
var tabBar = document.getElementById(“crmTabBar”);
if (tabBar)
{
var tabs = tabBar.childNodes;</pre>
<pre>for (var i = 0, len = tabs.length; i &lt; len; i++)
{
var currentTab = tabs[i];
if (currentTab.innerText === tabText)
{
return currentTab;
}
}
}
}</pre>
<pre>function TabStatus(tabText)
{
var tabBar = document.getElementById(“crmTabBar”);
if (tabBar)
{
var tabs = tabBar.childNodes;</pre>
<pre>for (var i = 0, len = tabs.length; i &lt; len; i++)
{
var currentTab = tabs[i];
if (currentTab.innerText === tabText)
{
if (currentTab.style.display == ‘none’)
{
alert(“tab already hidden, TAB NAME: ” + currentTab.innerText );
return “none”;
}
else
{
alert(“tab is visible, TAB NAME: ” + currentTab.innerText );
return “”;
}
}
}
}
}</pre>
<pre>//-----------------------------------------------------------------------</pre>
<pre>Please comment below if you have any feedback or anything to add.</pre>
<pre>Thanks</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.mohamedibrahim.net/blog/2010/03/03/hide-tab-in-any-entity-form-in-microsoft-dynamics-crm-4-using-javascript-in-onload-event-of-the-form/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Return and display picklist value (display value) in custom sql report  reporting services report in Microsoft Dynamics CRM 4 entity attribute and StringMap picklist values table</title>
		<link>http://www.mohamedibrahim.net/blog/2010/02/24/return-and-display-picklist-value-display-value-in-custom-sql-report-reporting-services-report-in-microsoft-dynamics-crm-4-entity-attribute-and-stringmap-picklist-values-table/</link>
		<comments>http://www.mohamedibrahim.net/blog/2010/02/24/return-and-display-picklist-value-display-value-in-custom-sql-report-reporting-services-report-in-microsoft-dynamics-crm-4-entity-attribute-and-stringmap-picklist-values-table/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 17:56:31 +0000</pubDate>
		<dc:creator>Mohamed Ibrahim Mostafa</dc:creator>
				<category><![CDATA[Microsoft Dynamics CRM]]></category>
		<category><![CDATA[Microsoft SQL Server]]></category>
		<category><![CDATA[CRM]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Queries]]></category>
		<category><![CDATA[Query]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.mohamedibrahim.net/blog/?p=172</guid>
		<description><![CDATA[Normally, you should be able to get the picklist display value and picklist item id in the filtered view of any entity. In some cases, you may need to work with StringMap table directly to get the picklist values for a specific field of a given entity. This could be the case if you are [...]]]></description>
			<content:encoded><![CDATA[<p>Normally, you should be able to get the picklist display value and picklist item id in the filtered view of any entity. In some cases, you may need to work with StringMap table directly to get the picklist values for a specific field of a given entity. This could be the case if you are not using the filtered view for some reason or if you want to write a report based on the table or the non-filtered view, the following post is providng the query (queries) needed to do so.</p>
<p>To get the display value of any picklist, you need to use the StringMap table. If you are writing a custom ssrs (SQL Server Reporting Services) report for Dynamics CRM 4, you usually need to return the picklist display value not the picklist item id.</p>
<p>For example: in the opportunity entity, you have a picklist attribute &#8220;Rating&#8221; (attribute name opportunityratingcode). If you are writing a custom SQL report to add to CRM and you want to display the values of the attribute, you will find that the display value of the picklist is not stored in the filtered view of Opportunity (FilteredOpportunity). To get the display value of any picklist, you need to use the StringMap table.</p>
<p>There many ways to get the information from the StringMap table, I will mention two ways here:</p>
<pre>1) using Inner Join (simple - one picklist only)
This way, you just simply join the two tables: your entity filteredview and the StringMap table
/* the query uses out of the box attributes, so should run successfully on all CRM organisations*/
SELECT opp.name, opp.estimatedvalue_base, opp.closeprobability, StringMap.Value
FROM Opportunity as Opp INNER JOIN
  StringMap ON Opp.opportunityratingcode = StringMap.AttributeValue
WHERE (StringMap.ObjectTypeCode = 3) AND (StringMap.AttributeName = N'opportunityratingcode')
AND (opp.accountid = 'input your accoung GUID here'</pre>
<p>This query will return list of all Opportunities for the specified account display the picklist display value rather than the id.</p>
<p>2) using Temp table (my prefered way for multiple picklists)</p>
<p>This query is longer and uses/declares temp tables but it is the simplest way in case you have several picklists and you want to return the display value of multiple picklists. You just create several temp tables just like @TempSM, where each temp table returns the list of display values for each picklist and then join them together.</p>
<pre>1 Picklist query:
/* the query uses out of the box attributes, so should run successfully on all CRM organisations*/
Declare @TempOpp table(OpportunityID uniqueidentifier, OpportunityName nVarchar(max),
Estimatedvalue float, Probability float, Rating nVarchar(max))
Insert into @TempOpp
select opp.opportunityid,opp.name ,
opp.estimatedvalue_base,
opp.closeprobability,
opp.OpportunityRatingCode
From Opportunity opp
where opp.accountid = '97F97A5A-2622-DF11-A1C3-005056BA6B8A'
Declare @TempSM table(AttributeValue nVarchar(max), Value nVarchar(max))
Insert into @TempSM
select AttributeValue, Value
from StringMap
WHERE (StringMap.ObjectTypeCode = 3) AND
(StringMap.AttributeName = N'opportunityratingcode' )
select t1.OpportunityName, t1.Estimatedvalue, t1.Probability, t2.Value as RatingDisplayValue
from @TempOpp as t1 left outer JOIN @TempSM as t2 ON
(t1.Rating = t2.AttributeValue)</pre>
<p>This query will return list of all Opportunities for the specified account display the picklist display value rather than the id.</p>
<pre>2 Picklists query:
------------------
/* the query uses out of the box attributes, so should run successfully on all CRM organisations*/
Declare @TempOpp1 table(OpportunityID uniqueidentifier, OpportunityName nVarchar(max),
Estimatedvalue float, Probability float, Rating nVarchar(max), Priority nVarchar(max))
Insert into @TempOpp1
select opp.opportunityid,opp.name ,
opp.estimatedvalue_base,
opp.closeprobability,
opp.OpportunityRatingCode,
opp.PriorityCode
From Opportunity opp
where opp.accountid = '97F97A5A-2622-DF11-A1C3-005056BA6B8A'
/* Now we have @TempOpp1 with list of all opportunities for the specified account but with ID for picklist value not display names*/
/*Then we declare a temp table for Rating picklist*/
Declare @TempSM table(AttributeValue nVarchar(max), Value nVarchar(max))
Insert into @TempSM
select AttributeValue, Value
from StringMap
WHERE (StringMap.ObjectTypeCode = 3) AND
(StringMap.AttributeName = N'opportunityratingcode' )
Declare @TempOpp2 table(OpportunityID uniqueidentifier, OpportunityName nVarchar(max),
Estimatedvalue float, Probability float, Rating nVarchar(max), Priority nVarchar(max))
Insert into @TempOpp2
select t1.OpportunityID, t1.OpportunityName, t1.Estimatedvalue, t1.Probability,
t2.Value as RatingDisplayValue,t1.Priority as Priority
from @TempOpp1 as t1 left outer JOIN @TempSM as t2 ON
(t1.Rating = t2.AttributeValue)
/*tempopp2 now has opportunities with the rating display value*/
/*Now creating a temp table for Priority picklist*/
Declare @TempSM1 table(AttributeValue nVarchar(max), Value nVarchar(max))
Insert into @TempSM1
select AttributeValue, Value
from StringMap
WHERE (StringMap.ObjectTypeCode = 3) AND
(StringMap.AttributeName = N'PriorityCode' )
select t1.OpportunityID, t1.OpportunityName, t1.Estimatedvalue, t1.Probability,
t1.Rating as RatingDisplayValue,t2.Value as Priority
from @TempOpp2 as t1 left outer JOIN @TempSM1 as t2 ON
(t1.Rating = t2.AttributeValue)

--------------------------------------------</pre>
<p>and so on. You create temp table for each picklist, join it with opportunity temp table and then carry on.</p>
<p>Note: This is one way of doing this. There are obviously many other shorter ways of doing this. I personally prefer temp tables a lot because although longer, they are simpler and easier to use. They also bypass any issues with null values in the right table of the join.</p>
<p>Not related Note: Always use filtered views when writing custom SQL reports on SSRS for CRM as they comply with CRM security.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mohamedibrahim.net/blog/2010/02/24/return-and-display-picklist-value-display-value-in-custom-sql-report-reporting-services-report-in-microsoft-dynamics-crm-4-entity-attribute-and-stringmap-picklist-values-table/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Hide, Display, Resize and Rename left navigation links, CRM fields and attributes using Javascript for Microsoft Dyanmics CRM 4.</title>
		<link>http://www.mohamedibrahim.net/blog/2010/02/17/hide-display-resize-and-rename-left-navigation-links-crm-fields-and-attributes-using-javascript-for-microsoft-dyanmics-crm-4/</link>
		<comments>http://www.mohamedibrahim.net/blog/2010/02/17/hide-display-resize-and-rename-left-navigation-links-crm-fields-and-attributes-using-javascript-for-microsoft-dyanmics-crm-4/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 18:00:32 +0000</pubDate>
		<dc:creator>Mohamed Ibrahim Mostafa</dc:creator>
				<category><![CDATA[Microsoft Dynamics CRM]]></category>
		<category><![CDATA[CRM]]></category>
		<category><![CDATA[Custom Entity]]></category>
		<category><![CDATA[Field]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.mohamedibrahim.net/blog/?p=164</guid>
		<description><![CDATA[Scripts for Resizing, Hiding and renaming left navigation links, fields and attributes in Microsoft Dynamics CRM 4 using Javascript.]]></description>
			<content:encoded><![CDATA[<p>Scripts for Resizing, Hiding and renaming left navigation links, fields and attributes in Microsoft Dynamics CRM 4 using Javascript. This post is just a collection of some Javascript code for various common scripts that is frequently used in CRM form events, CRM entity events, etc. These script blocks can be used in OnLoad, OnSave events for CRM forms and OnChange events for CRM fields.</p>
<pre>//------- Resize CRM form in the onload event
window.resizeTo(screen.availWidth * 0.85, screen.availHeight * 0.85);</pre>
<pre>//-------Rename left menu link / Left Navigation. Example: Contacts
var navItem = document.getElementById(’navContacts’);
navItem.innerHTML = navItem.innerHTML.replace(’&gt;Contacts’,'&gt;Students’);</pre>
<pre>//------Hide left menu link / Navigation. Example: Workflow
var navLeftItem = document.getElementById(’navAsyncOperations’);
navLeftItem.style.display = ‘none’;</pre>
<pre>//-----Hide Left navigation menu item link of a CRM form based on
// a value in a picklist on the same form.
//Get contacts left navigation menu item element.
var navLeftItem = document.getElementById(’navContacts’);
//if picklist (customer type code) value is equal to 1 (1st item in picklist) then
//hide left menu item (contacts link is used as an example), otherwise, show it.
if(crmForm.all.customertypecode.DataValue == 1)
{
 navLeftItem.style.display = ‘none’;
}
else
{
 navLeftItem.style.display = ‘inline’;
}</pre>
<pre> //-----Hide a CRM field on a form. example: the "name" field.
crmForm.all.name_c.style.display = 'inline';
crmForm.all.name_d.style.display = 'inline';</pre>
<pre>//-----Hide a CRM field on a form (example: the "name" field)
//based on the selected value in a picklist
if(crmForm.all.customertypecode.DataValue == 1)
{
         crmForm.all.name_c.style.display = 'inline';
         crmForm.all.name_d.style.display = 'inline';
}
else
{
         crmForm.all.name_c.style.display = 'none';
         crmForm.all.name_d.style.display = 'none';
}  ////Add this code to the OnLoad event of the form and
////to the on change event of the picklist attribute (field) as well</pre>
<pre>//---------Function to hide CRM field in a form.
//Function accept fieldname as a parameter and
//boolean parameter to remove (hide) entire row on form
HideField('name'); //replace "name" with your field/attribute name
 
function HideField( fieldName, removeEntireRow )
{
 // Always hide the elements, even if we will be hiding the whole row.
 // This allows us to show another field in this row later without this
 // one showing up.
 var elem = crmForm.all[fieldName + "_c"];
 if( elem != null ) elem.style.display = "none";
 elem = crmForm.all[fieldName + "_d"];
 if( elem != null ) elem.style.display = "none";    
 
 if (removeEntireRow)
 {
  var elem = crmForm.all[fieldName + "_d"];
  if( elem != null ) elem.parentElement.style.display = "none";
 }
}</pre>
<p> This post was written quickly from memory and some code blocks here and there, so you might find some minor spelling mistakes. Please comment below if you find any issues with the script blocks or if you want me to extend this post to include additional script.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mohamedibrahim.net/blog/2010/02/17/hide-display-resize-and-rename-left-navigation-links-crm-fields-and-attributes-using-javascript-for-microsoft-dyanmics-crm-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Script to Hide Add Existing Record button and Add New Record button using Javascript in Microsoft Dyanmics CRM</title>
		<link>http://www.mohamedibrahim.net/blog/2010/02/10/script-to-hide-add-existing-record-button-and-add-new-record-button-using-javascript-in-microsoft-dyanmics-crm/</link>
		<comments>http://www.mohamedibrahim.net/blog/2010/02/10/script-to-hide-add-existing-record-button-and-add-new-record-button-using-javascript-in-microsoft-dyanmics-crm/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 17:26:29 +0000</pubDate>
		<dc:creator>Mohamed Ibrahim Mostafa</dc:creator>
				<category><![CDATA[Microsoft Dynamics CRM]]></category>
		<category><![CDATA[Add Existing]]></category>
		<category><![CDATA[Add new]]></category>
		<category><![CDATA[Associatev View]]></category>
		<category><![CDATA[CRM]]></category>
		<category><![CDATA[Custom Entity]]></category>
		<category><![CDATA[Entity]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://www.mohamedibrahim.net/blog/?p=166</guid>
		<description><![CDATA[Script to Hide Add Existing Record button and Add New Record button using Javascript in Microsoft Dyanmics CRM]]></description>
			<content:encoded><![CDATA[<p>If you want to hide the two top left  buttons in the assicated view of any entity,  Add Existing Record and Add New Record Buttons, you can use the following javascript code i the onLoad Event of the Microsofty Dyanmics CRM 4 Form.  This post relies on and is an extension to <a title="http://blog.davehawes.com/post/2008/04/23/MSCRM-4-Remove-Add-Existing-xxxxx-button.aspx" href="http://" target="_blank">the existing useful post by Dave Hawes</a>.</p>
<p> //This javascript should be added to the onLoad event for the form of the entity where you want to hide buttons for the associated views of other entities</p>
<pre>//-------Hide Add Existing Record Button Only----Method 1----
HideAssociatedViewButton('new_account_new_project', 'Add existing Project to this record');
function HideAssociatedViewButton(loadAreaId, buttonTitle)
{
    var navElement = document.getElementById('nav_' + loadAreaId);
    if (navElement != null)
    {
        navElement.onclick = function LoadAreaOverride()
        {
            // Call the original method to launch the navigation link
            loadArea(loadAreaId);</pre>
<pre>            var associatedViewIFrame = document.getElementById(loadAreaId + 'Frame');
            if (associatedViewIFrame != null)
            {
                associatedViewIFrame.onreadystatechange = function HideTitledButton()
                {
                    if (associatedViewIFrame.readyState == 'complete')
                    {
                        var iFrame = frames[window.event.srcElement.id];
                        var liElements = iFrame.document.getElementsByTagName('li');
                        for (var i = 0; i &lt; liElements.length; i++)
                        {
                            if (liElements[i].getAttribute('title') == buttonTitle)
                            {
                                liElements[i].style.display = 'none'; //this will hide and align properly
                                liElements[i].style.visibility = 'hidden'; // this is needed when re-sizing cause button to re-appear.
                                break;
                            }
                        }
                    }
                }
            }
        }
    }
}</pre>
<p>//&#8212;End of Hide Add existing button Only</p>
<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;Hide Add New Record Button and Add Existing Button &#8212;&#8212;&#8212;</p>
<pre>//Hide Both Buttons-----------
HideAssociatedViewButtons('new_account_new_project', ['Add existing Project to this record', 'Add a new Project to this record']); //Where "Project" is a custom entity.
//OR Hide Add Existing Button Only-----Method 2-------
HideAssociatedViewButtons('new_account_new_project', ['Add existing Project to this record']);  //Where "Project" is a custom entity.

function HideAssociatedViewButtons(loadAreaId, buttonTitles){
    var navElement = document.getElementById('nav_' + loadAreaId);
   if (navElement != null)    {
        navElement.onclick = function LoadAreaOverride()        {
            // Call the original CRM method to launch the navigation link and create area iFrame
            loadArea(loadAreaId);
            HideViewButtons(document.getElementById(loadAreaId + 'Frame'), buttonTitles);
        }
    }
}

function HideViewButtons(Iframe, buttonTitles) {
    if (Iframe != null ) {
        Iframe.onreadystatechange = function HideTitledButtons() {
            if (Iframe.readyState == 'complete') {
                var iFrame = frames[window.event.srcElement.id];
                var liElements = iFrame.document.getElementsByTagName('li');

                for (var j = 0; j &lt; buttonTitles.length; j++) {
                    for (var i = 0; i &lt; liElements.length; i++) {
                        if (liElements[i].getAttribute('title') == buttonTitles[j]) {
                             liElements[i].style.display = 'none'; //this will hide and align properly
                             liElements[i].style.visibility = 'hidden'; // this is needed when re-sizing cause button to re-appear.
                            break;
                        }
                    }
                }
            }
        }
    }
} </pre>
<p>Credit goes to Dave Hawes Blog post mentioned above.</p>
<pre> </pre>
]]></content:encoded>
			<wfw:commentRss>http://www.mohamedibrahim.net/blog/2010/02/10/script-to-hide-add-existing-record-button-and-add-new-record-button-using-javascript-in-microsoft-dyanmics-crm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating and Using Silverlight web.config app settings (Web.config Configuration Applicatioin Settings) or app.config application settings configuration file for Silverlight</title>
		<link>http://www.mohamedibrahim.net/blog/2010/01/27/creating-and-using-silverlight-app-settings-webconfig-configuration-applicatioin-settings-to-change-wcf-service-address-after-deployment-servicereferencesclientconfig-servicereferences-clientconfig/</link>
		<comments>http://www.mohamedibrahim.net/blog/2010/01/27/creating-and-using-silverlight-app-settings-webconfig-configuration-applicatioin-settings-to-change-wcf-service-address-after-deployment-servicereferencesclientconfig-servicereferences-clientconfig/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 21:47:30 +0000</pubDate>
		<dc:creator>Mohamed Ibrahim Mostafa</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[General Development]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Configuraiton]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[ServiceReferences.ClientConfig]]></category>
		<category><![CDATA[Settings]]></category>
		<category><![CDATA[xap]]></category>

		<guid isPermaLink="false">http://www.mohamedibrahim.net/blog/?p=149</guid>
		<description><![CDATA[Post Summary:
This posts explains how to create and use something similar to a silverlight  web.config, App.config and appsettings (or app settings) configuration file for silverlight application. This is based on re-using serviceReference.clientconfig as an appconfig configuration file.
The Problem:
A) configuration application settings (like the one in web.config, appsettings or app settings application configuration file):
This is probably very common. Your [...]]]></description>
			<content:encoded><![CDATA[<p><span style="text-decoration: underline;">Post Summary:</span></p>
<p>This posts explains how to create and use something similar to a silverlight  web.config, App.config and appsettings (or app settings) configuration file for silverlight application. This is based on re-using serviceReference.clientconfig as an appconfig configuration file.</p>
<p><span style="text-decoration: underline;">The Problem:</span></p>
<p><span style="text-decoration: underline;">A) configuration application settings (like the one in web.config, appsettings or app settings application configuration file):</span><br />
This is probably very common. Your silverlight application might well need to have some configuration settings that you can change their values without having to re-build and re-deploy the whole application because of a small change in a connection string or appSetting value. Again, AppSettings in good old web.config files in ASP.net applications were the best solution in this case.</p>
<p><span style="text-decoration: underline;">B) WCF Address (EndPoint address value) change after building:</span><br />
Another reason for wanting to have a configuration file in a silverlight application: Have you ever wanted to change the WCF service address (endpoint address) in your silverlight application after deployment. Imagine that you built a silverlight application and deployed it on your test server. The application was tested and confirmed issues and bug free. Now you want to re-deploy the application to the Live server but the WCF service address (end point address) is different which is probably quite common. It might also be that the address is the same but the port on which the WCF service is listening is different. In this case, you will need to change the value of the WCF endpoint address and re-build. So what happened to configuration files! They are a standard now in all Microsoft environments. </p>
<p><span style="text-decoration: underline;">Problem Summary:</span> The problem is there is no clear web.config file in silverlight as the whole code is compiled into a (.xap) file which any html or aspx page can call.</p>
<p><span style="text-decoration: underline;">Solution:</span></p>
<p>In my silverlight application, I had a connection string value that I need to use in my silverlight application (pass it to the webservice). Hence, I wanted the flexibility to change the WCF endpoint address and the connection string configuration value (or any other application setting). I started looking for a solution but I found that most work arounds were either two long or too complicated. As always, I like simple things and I don&#8217;t like over complications. I have to say though that most if not all work arounds that I found were useful for me to come up with this solution. I am not sure but I believe (and hope) the following solution is unique as I have searched for quite a while to find anyone suggesting this idea but I couldn&#8217;t find any.</p>
<p><strong><span style="text-decoration: underline;">Solution part 1</span>: The simplest way for adding application settings to a silverlight application.</strong></p>
<p>Now since ServiceReferences.ClientConfig is just an xml configuration file, you can actually edit it in visual studio and simply add your application settings.</p>
<p>Your file will look something like this:</p>
<pre>&lt;configuration&gt;
    &lt;system.serviceModel&gt;
        &lt;bindings&gt;
            &lt;basicHttpBinding&gt;
                &lt;binding name="xrmServiceBasicHttp" maxBufferSize="2147483647"
                    maxReceivedMessageSize="2147483647"&gt;
                    &lt;security mode="None"&gt;
                        &lt;transport&gt;
                            &lt;extendedProtectionPolicy policyEnforcement="Never" /&gt;
                        &lt;/transport&gt;
                    &lt;/security&gt;
                &lt;/binding&gt;
            &lt;/basicHttpBinding&gt;
        &lt;/bindings&gt;
        &lt;client&gt;
            &lt;endpoint address="<a href="http://localhost:1234/MyWCFService.svc">http://localhost:1234/MyWCFService.svc</a>" binding="basicHttpBinding"
                bindingConfiguration="xrmServiceBasicHttp" contract="XrmService.IXrmService"
                name="xrmServiceBasicHttp" /&gt;
        &lt;/client&gt;
    &lt;/system.serviceModel&gt;</pre>
<pre><strong>  &lt;appSettings&gt;
    &lt;add key="ConnectionString" value="data source=ABC01;initial catalog=DB01;integrated security=SSPI;persist security info=False;packet size=4096" /&gt;
  &lt;/appSettings&gt;</strong></pre>
<pre>&lt;/configuration&gt;</pre>
<p>Now that you have added your application setting (connection string) to your ServiceReferences.ClientConfig, you need to use it in your silverlight code behind (.xaml.cs) file.</p>
<p>Remember, ServiceReferences.ClientConfig is just an XML file (already said that many times!). Hence, you can write a very simple and straight forward function that parses your ServiceReferences.ClientConfig xml file and returns the appSetting value of your application setting.<br />
A function to return an AppSetting value from your clientconfig file can look something like this:</p>
<pre>private string getAppSetting(string strKey)
        {
            string strValue = string.Empty;
            XmlReaderSettings settings = new XmlReaderSettings();           
            settings.XmlResolver = new XmlXapResolver();
            XmlReader reader = XmlReader.Create("ServiceReferences.ClientConfig");
            reader.MoveToContent();
            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element &amp;&amp; reader.Name == "add")
                {
                    if (reader.HasAttributes)
                    {
                        strValue = reader.GetAttribute("key");
                        if (!string.IsNullOrEmpty(strValue) &amp;&amp; strValue == strKey)
                        {
                            strValue = reader.GetAttribute("value");
                            return strValue;
                        }
                    }
                }
            }
            return strValue;</pre>
<pre>        }
Finally in your code, to retrieve the AppSetting value for the appSetting key (ConnectionString) that you created, you can just call the above function like this:</pre>
<p>client.SetConnectionStringAsync(getAppSetting(&#8220;ConnectionString&#8221;));<br />
And One last thing, remember when you create the WCF service client object, don&#8217;t explicitly call the WCF service address, as it is already in your ClientConfig file.</p>
<p>So, just call the end Point Configuration Name (endPointConfigurationName) that you want to use. Just like this:</p>
<p>MyServiceClient client = new MyServiceClient(&#8220;MyServiceBasicHttp&#8221;);</p>
<p>&#8212;&#8212;&#8212;-</p>
<p><strong><span style="text-decoration: underline;">Solution part 2:</span> Changing WCF address and endpoint values in &#8220;ServiceReferences.ClientConfig&#8221;.</strong></p>
<p>Anyway, the first thing we need to do is to understand that &#8220;ServiceReferences.ClientConfig&#8221; that all silverlight applications have and use if they are connecting to a WCF sercvice, is just a simple XML file. Actually, not only an XML file but also a configuration file for the application.</p>
<p>You also need to know that the silverlight xap (*.xap) file that silverlight generates is a simple compressed (zipped) file. For this reason, you actually can rename the file to (something.zip) from (something.xap) and then you can access its content. The content of the xap file includes AppManifes.xaml, your application dlls and most importantly &#8220;ServiceReferences.ClientConfig&#8221;.</p>
<p>Now, when I tried to unzip it, change the content of one of its files and then re-zip it and rename it back to (something.xap), this has corrupted it. My application failed. I am not sure why. This was the case despite the fact that most posts about unpacking, unzipping and re-packaging the .xap file works.</p>
<p>What actually works is the following:<br />
Rename the something.xap file to something.zip file. Open the zip file without unzipping (just double click on it) and then copy the file you want to edit, which in our case is the &#8220;ServiceReferences.ClientConfig&#8221; and paste it in a different location. Edit it and make all the changes you need to it and then copy it and paste back into the something.zip file. Replace the exisitng file there. Now go to something.zip and rename it back to something.xap.</p>
<p>Whatever change you have made should now work.</p>
<p>&#8212;&#8212;&#8212;&#8211;</p>
<p>I hope this helps. I really think it is an effective way to get your AppSetting values.</p>
<p>If you got any questions, please comment below (Kindly don&#8217;t use the contact page for questions on posts please)</p>
<p>Also, please let me know (via a comment below) if you want a copy of this application code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mohamedibrahim.net/blog/2010/01/27/creating-and-using-silverlight-app-settings-webconfig-configuration-applicatioin-settings-to-change-wcf-service-address-after-deployment-servicereferencesclientconfig-servicereferences-clientconfig/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Problems with Deploying WCF services on IIS 7.0 (or IIS 6, IIS) and other deployment options and scenarios (visual studio .NET and Windows Activation Services)</title>
		<link>http://www.mohamedibrahim.net/blog/2010/01/24/problems-with-deploying-wcf-services-on-iis-70-or-iis-6-iis-and-other-deployment-options-and-scenarios-visual-studio-net-and-windows-activation-services/</link>
		<comments>http://www.mohamedibrahim.net/blog/2010/01/24/problems-with-deploying-wcf-services-on-iis-70-or-iis-6-iis-and-other-deployment-options-and-scenarios-visual-studio-net-and-windows-activation-services/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 19:21:05 +0000</pubDate>
		<dc:creator>Mohamed Ibrahim Mostafa</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Handler Mapping]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Modules]]></category>

		<guid isPermaLink="false">http://www.mohamedibrahim.net/blog/?p=143</guid>
		<description><![CDATA[There are 3 main ways to deploy Windows Communication Foundation &#8211; WCF services to consume:
1- IIS
2- Windows Activation Service a.k.a WAS
3- Visual Studio .NET for development and dev testing purposes as part of a visual studio solution.
For full details about Windows Communciation Foundation deployment scenarios, categories and structure please refer to this MSDN article: http://msdn.microsoft.com/en-us/library/cc512374.aspx
This [...]]]></description>
			<content:encoded><![CDATA[<p>There are 3 main ways to deploy Windows Communication Foundation &#8211; WCF services to consume:</p>
<p>1- IIS<br />
2- Windows Activation Service a.k.a WAS<br />
3- Visual Studio .NET for development and dev testing purposes as part of a visual studio solution.</p>
<p>For full details about Windows Communciation Foundation deployment scenarios, categories and structure please refer to this MSDN article: <a href="http://msdn.microsoft.com/en-us/library/cc512374.aspx">http://msdn.microsoft.com/en-us/library/cc512374.aspx</a></p>
<p>This post is focusing on issues and problems faced with WCF running on IIS.</p>
<p>Recently, I had a working WCF service that I wanted to deploy on one of my client&#8217;s web servers. The webserver is a simple Windows 2008 web server with obviously web server role turned on.</p>
<p>After publishing the WCF service, I logged on the web server&#8217;s IIS 7 management console and started creating the webservice as a separate website. Please note that you may be able to create the web service as a web application under the default website or any website if you want (haven&#8217;t tried it before but should work). But do NOT do this if your default website is a Microsoft Dynamics CRM application server. Reason being that if you do add a webservice under Microsoft Dynamics CRM website, you will probably cause problems and major issues with authentication, client policies, cross domains, etc, etc..</p>
<p>So, I created my WCF service as a new website. tryied to browse to the service .svc file (webservice.svc for example) but I got an error 404, no https handler avaialble to process this request. Error details says: &#8220;The page you requested has a file name extension that is not recognized, and is not allowed.&#8221;</p>
<p>Looking in my handler mappings, I found out that there is no resource Dlls or managed code, to handle responses for *.svc request type. Normally you should have one of three *.svc mappings:<br />
1- svc-Integrated handling *.svc &#8211; handler is System.ServiceModel.Activation.HttpHandler<br />
2- svc-ISAPI-2.0-64 handling *.svc &#8211; handler this time is IsapiModule<br />
3- svc-ISAPI-2.0 handling *.svc &#8211; handler is also IsapiModule.</p>
<p>If you dont have these handler mappings (although you normally should), make sure you add them manually. If you try to add them and can&#8217;t find any of the modules: IsapiModule or System.ServiceModel.Activation.HttpHandler, then go to Modules and make sure these two modules are enabled and avaialble.</p>
<p>This fixed my issue. But, you may have another problem:</p>
<p>- Make sure that in windows features, you have both WCF options under .Net framework are ticked. So go to Control Panel &#8211;&gt; Programs and Features &#8211;&gt; Turn Windows Features ON/Off &#8211;&gt; Features &#8211;&gt; Add Features &#8211;&gt; .NET Framework X.X Features. Make sure that .Net framework says it is installed, and make sure that the WCF Activation node underneath it is selected (checkbox ticked) and both options under WCF Activation are also checked. These are:<br />
* HTTP Activation<br />
* Non-HTTP Activation<br />
Both options need to be selected (checked box ticked).</p>
<p>- Make sure that the website is running as ASP .NET 2.0</p>
<p>- If you are still having problems, try Registering WCF From The Command Prompt . You can do this by running the following command from a command prompt (In Windows 7 you need to run command prompt as administrator &#8211; right click on shortcut and then click run as administrator).<br />
To register WCF from the command prompt, use the following commands:</p>
<p>Navigate to WCF folder:</p>
<p>cd %SYSTEMROOT%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation</p>
<p>Where %SYSTEMROOT% is usually by default C:/Windows/</p>
<p>Then run this command:<br />
ServiceModelReg.exe /i /x</p>
<p>Alternatively just run the following command:<br />
%SYSTEMROOT%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe /i /x<br />
- If this still doesn&#8217;t work, please try the steps listed in this blog post: <a href="http://bloggingabout.net/blogs/jpsmit/archive/2007/01/17/wcf-http-404-when-hosted-in-iis.aspx">http://bloggingabout.net/blogs/jpsmit/archive/2007/01/17/wcf-http-404-when-hosted-in-iis.aspx</a></p>
<p>I haven&#8217;t tried any of these steps before but some people found it useful.<br />
All solutions are provided as is with no guarantees.</p>
<p>Please write a comment with any questions or experience you have with deploying WCF on IIS 7<br />
Hope this helps.</p>
<p>Thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mohamedibrahim.net/blog/2010/01/24/problems-with-deploying-wcf-services-on-iis-70-or-iis-6-iis-and-other-deployment-options-and-scenarios-visual-studio-net-and-windows-activation-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
