﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Michael Thompson MCP, A+, Network+, BSIT</title>
    <description>VB .Net developer
C# .Net developer
MCP, A+, Network+,BSIT</description>
    <link>http://www.askcrm.com/Home/tabid/866/BlogId/23/Default.aspx</link>
    <language>en-US</language>
    <webMaster>luck@customer-connect.com</webMaster>
    <pubDate>Tue, 09 Mar 2010 21:01:53 GMT</pubDate>
    <lastBuildDate>Tue, 09 Mar 2010 21:01:53 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>Blog RSS Generator Version 3.4.0.39853</generator>
    <item>
      <title>MS CRM 4.0 Picklist Changes Not Saving (and on purpose)</title>
      <description>&lt;p&gt;In MS CRM 4.0 any field changes made that are enabled will be save.  Lets say on the Account form you have a picklist that will display the following in an IFrame.&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Map to Account Address&lt;/li&gt;
    &lt;li&gt;Accounts Web-page&lt;/li&gt;
    &lt;li&gt;Primary Contact Information&lt;/li&gt;
    &lt;li&gt;Page to ERP showing Credit Stats.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When you change the CRM picklist controlling the IFrame CRM will change to IsDirty (asking you to save or not on exit).  You really probably don't want to allow of force the user to save every time they look at the account.&lt;/p&gt;
&lt;p&gt;Options are to set the picklist back to original value which takes a few lines of code and attaching to the OnSave or Close event.  Too much coding.&lt;/p&gt;
&lt;p&gt;Easy answer ahead.  Looking in CRM through debugger and IE toolbar there is a field value that CRM is monitoring to determine if the picklist has changed.  If we set the currently selected to that value CRM will not save the field as it is back to the original value.  As I said I don't want the user changing this field to the database so I found a way around it.  Since you can access IsDirty to set the value to dirty and form but cannot set it to false. here is the answer.&lt;/p&gt;
&lt;h2&gt;&lt;em&gt;&lt;strong&gt;Behind the picklist OnChange event:&lt;/strong&gt;&lt;/em&gt;&lt;/h2&gt;
&lt;p&gt;&lt;br /&gt;
&lt;font color="#0000ff"&gt;crmForm.all.&lt;span style="background-color: rgb(255,255,0)"&gt;[yourpicklistname]&lt;/span&gt;.defaultSelected = crmForm.all.&lt;span style="background-color: rgb(255,255,0)"&gt;[yourpicklistname]&lt;/span&gt;.DataValue;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Now no matter what the user selects on exit of the account form the OnChange or Close will not look at the picklist as it thinks it has not changed.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;**Note if the field is new to the form setting default value will still leave records created before field to bring picklist with null value.  OnLoad you will probably want to set the default picklist value to the first entry or set it by different parameters depending on account values such as Pass Due or Credit Card expired.&lt;/em&gt;&lt;/p&gt;
&lt;address&gt; &lt;/address&gt;
&lt;h2&gt;&lt;em&gt;Behind the Account OnLoad event:&lt;/em&gt;&lt;/h2&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;crmForm.all.&lt;span style="background-color: rgb(255,255,0)"&gt;[yourpicklistname]&lt;/span&gt;.DataValue = 1;&lt;/font&gt;&lt;/p&gt;</description>
      <link>http://www.askcrm.com/Home/tabid/866/EntryID/90/Default.aspx</link>
      <comments>http://www.askcrm.com/Home/tabid/866/EntryID/90/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.askcrm.com/Default.aspx?tabid=866&amp;EntryID=90</guid>
      <pubDate>Thu, 12 Mar 2009 18:39:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.askcrm.com/DesktopModules/Blog/Trackback.aspx?id=90</trackback:ping>
    </item>
    <item>
      <title>MS CRM 4.0 Rename or Remove Left Nav Bar Menu Items.</title>
      <description>&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;
&lt;div class="clear"&gt;
&lt;p&gt; In MS CRM 4.0 have you ever wanted to rename or remove Left Nav links on an entity only to find the OnLoad script fails when trying to use the preview function on the form designer? &lt;/p&gt;
&lt;p&gt;In many CRM installs companies prefer to not use the Microsoft CRM product catalog so that Write-In Products is really the list of products (on a Quote for example) and Existing Products never has anything listed under it.  Thus they would prefer to eliminate the Existing Products link in the left nav area, and rename "Write In Products" to "Products" or possibly "Line Items."&lt;/p&gt;
&lt;p&gt;The scripts below rename the Write-In Products link and remove the Existing Products link.  They also check to see if the link exists before going through the function, thus preserving the preview functionality of the form designer (if you preview a form without running this check, then the preview will throw and error).  This rename also avoids going to the server to pull icons as many other scripts do.  Note in the rename function a line is repeated twice.  No it is not a mistake, it is needed.  The rename function passes in 3 parameters (navName, Display text, &lt;em&gt;name you want displayed&lt;/em&gt;).  You will probably need something like &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038&amp;displaylang=en"&gt;IE Dev toolbar&lt;/a&gt; to be able to find the navName.&lt;/p&gt;
&lt;/div&gt;
&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt; &lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt; color: green;"&gt;/* Retext/Rename Left Nav Display links. */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt; color: blue;"&gt;function&lt;/span&gt;&lt;span courier="" style="font-size: 10pt;"&gt; leftNavRename(leftNav, oldName, newName)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt;"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;var&lt;/span&gt; navItem = document.getElementById(leftNav);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt;"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt;(navItem&lt;span style=""&gt;  &lt;/span&gt;!= &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt;"&gt;&lt;span style=""&gt;    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt;"&gt;&lt;span style=""&gt;        &lt;/span&gt;navItem.innerHTML = navItem.innerHTML.replace(oldName, newName);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt;"&gt;&lt;span style=""&gt;        &lt;/span&gt;navItem.innerHTML = navItem.innerHTML.replace(oldName, newName);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt;"&gt;&lt;span style=""&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt;"&gt;} &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt;"&gt;leftNavRename (&lt;span style="color: rgb(163, 21, 21);"&gt;'navWriteInProducts'&lt;/span&gt;,&lt;span style="color: rgb(163, 21, 21);"&gt;'Write-In Products'&lt;/span&gt;,&lt;span style="color: rgb(163, 21, 21);"&gt;'Products'&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt; color: green;"&gt;/* Remove Left Nav bar links */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt; color: blue;"&gt;function&lt;/span&gt;&lt;span courier="" style="font-size: 10pt;"&gt; leftNavRemove(lNav)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt;"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;var&lt;/span&gt; lNavItem = document.getElementById(lNav);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt;"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (lNavItem != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt;"&gt;&lt;span style=""&gt;    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt;"&gt;&lt;span style=""&gt;        &lt;/span&gt;lNavItem.parentNode.style.display =&lt;span style="color: rgb(163, 21, 21);"&gt;'none'&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt;"&gt;&lt;span style=""&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt; line-height: normal;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt;" class="MsoNormal"&gt;&lt;span courier="" style="font-size: 10pt; line-height: 115%;"&gt;leftNavRemove(&lt;span style="color: rgb(163, 21, 21);"&gt;'navExistingProducts'&lt;/span&gt;);&lt;/span&gt;&lt;/p&gt;</description>
      <link>http://www.askcrm.com/Home/tabid/866/EntryID/80/Default.aspx</link>
      <comments>http://www.askcrm.com/Home/tabid/866/EntryID/80/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.askcrm.com/Default.aspx?tabid=866&amp;EntryID=80</guid>
      <pubDate>Mon, 02 Feb 2009 21:51:00 GMT</pubDate>
      <slash:comments>7</slash:comments>
      <trackback:ping>http://www.askcrm.com/DesktopModules/Blog/Trackback.aspx?id=80</trackback:ping>
    </item>
    <item>
      <title>MS CRM 4.0 How to Hide System Views</title>
      <description>&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt; &lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: " courier=""&gt;&lt;font color="#000000"&gt;In MSCRM 3.0 to hide system view just took a simple trick to the system.  In MSCRM 4.0 Microsoft removed the work around now not letting you get rid of unused or unwanted system views.  Doing some searches I found 2 different System View Hiding Plugins but I did not Like having to recompile or edit XML outside of CRM to get rid of the View.  So looking over the code on &lt;/font&gt;&lt;a href="http://code.msdn.microsoft.com/crm40hidesystemviews/Wiki/Recent.aspx"&gt;&lt;font color="#3366ff"&gt;MSDN&lt;/font&gt;&lt;/a&gt;&lt;font color="#000000"&gt; and Darren's CRM Blog, I decided to Modify &lt;/font&gt;&lt;a href="http://msdynamicscrm-e.blogspot.com/2008/02/hiding-view-in-crm-40-using-plug-in.html"&gt;&lt;font color="#3366ff"&gt;Darren's&lt;/font&gt;&lt;/a&gt;&lt;font color="#000000"&gt; Code not to look at pre built into the code GUIDs.  Instead I changed the Query expression to look at the name column (CRM View name and not bring in views starting with "Hidden".) once the plugin is in Open an Entity and open the unwanted view and open properties to rename and add Hidden to the beginning and then save and publish and it is gone from User's site.  Make sure not to try and hide all views or System Required views as it will throw errors in trying to do so.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt; &lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: " courier=""&gt;&lt;font color="#000000"&gt;To use this you will need Visual Studio 2005 or VS 2008.  You will also need the &lt;a href="http://www.microsoft.com/DOWNLOADS/details.aspx?familyid=82E632A7-FAF9-41E0-8EC1-A2662AAE9DFB&amp;displaylang=en"&gt;CRM 4.0 SDK&lt;/a&gt; for Plugin Registration tool and 2 DDLs (microsoft.crm.sdk.dll and microsoft.crm.sdktypeproxy.dll.  The code create a Class Library using C#.  The DLL from the SDK are needed as added references to the Assembly.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt; &lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: " courier=""&gt;&lt;font color="#000000"&gt;Information to Register Plugin:&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: " courier=""&gt;&lt;font color="#000000"&gt;To install you must have the Microsoft Plugin Registration Tool from The SDK.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: " courier=""&gt;&lt;font color="#000000"&gt;&lt;br /&gt;
Register the assembly&lt;br /&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: " courier=""&gt;&lt;font color="#000000"&gt;Then register a new step.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt; &lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: " courier=""&gt;&lt;font color="#000000"&gt;Meggage:  RetrieveMultiple&lt;br /&gt;
Primary Entity: savequery&lt;br /&gt;
Eventing Pipline: Pre Stage&lt;br /&gt;
Execution Mode: Synchronous&lt;br /&gt;
Step Deployment: Server                      &lt;u&gt;&lt;em&gt;You can also add Offline&lt;/em&gt;&lt;/u&gt; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: " courier=""&gt;&lt;font color="#000000"&gt;Triggering Pipeline: Parent Pipeline&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt; &lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt; &lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: " courier=""&gt;&lt;font color="#000000"&gt;The source code:&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt; &lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: " courier=""&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt; System;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: " courier=""&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt; System.Collections.Generic;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: " courier=""&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt; System.Text;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: " courier=""&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt; Microsoft.Crm.Sdk;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: " courier=""&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt; Microsoft.Crm.Sdk.Metadata;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: " courier=""&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt; Microsoft.Crm.Sdk.Query;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: " courier=""&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt; Microsoft.Crm.SdkTypeProxy;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: " courier=""&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt; Microsoft.Crm.SdkTypeProxy.Metadata;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: " courier=""&gt;namespace&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt; HideView&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 1"&gt;      &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;CCHideViewsPlugin&lt;/span&gt; : IPlugin&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 1"&gt;      &lt;/span&gt;{&lt;span style="mso-spacerun: yes"&gt;    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; Execute(IPluginExecutionContext context)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-spacerun: yes"&gt;            &lt;/span&gt;&lt;span style="color: green"&gt;/*Removed GUID Build from here*/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-spacerun: yes"&gt;            &lt;/span&gt;&lt;span style="color: green"&gt;/*orginal Idea came from http://msdynamicscrm-e.blogspot.com/2008/02/hiding-view-in-crm-40-using-plug-in.html */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="color: blue"&gt;if&lt;/span&gt; (context.InputParameters != &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;&lt;span style="color: blue"&gt;if&lt;/span&gt; (context.InputParameters.Properties.Contains(ParameterName.Query))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-spacerun: yes"&gt;                    &lt;/span&gt;&lt;span style="color: green"&gt;/*only apply this action if the query is for 'views' or saved queries*/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 5"&gt;                              &lt;/span&gt;QueryExpression qe = (QueryExpression)context.InputParameters.Properties[ParameterName.Query];&lt;span style="mso-spacerun: yes"&gt;                                        &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 5"&gt;                              &lt;/span&gt;&lt;span style="color: blue"&gt;if&lt;/span&gt; (qe.EntityName == &lt;span style="color: #a31515"&gt;"savedquery"&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 5"&gt;                              &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 6"&gt;                                    &lt;/span&gt;&lt;span style="color: blue"&gt;if&lt;/span&gt; (qe.Criteria != &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 6"&gt;                                    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 7"&gt;                                          &lt;/span&gt;&lt;span style="color: blue"&gt;if&lt;/span&gt; (qe.Criteria.Conditions != &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 8"&gt;                                                &lt;/span&gt;&lt;span style="color: green"&gt;/*The query is edited to look at views not starting with "Hidden" at the begining of the View Name*/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 8"&gt;                                                &lt;/span&gt;ConditionExpression queryCondition = &lt;span style="color: blue"&gt;new&lt;/span&gt; ConditionExpression(&lt;span style="color: #a31515"&gt;"name"&lt;/span&gt;, ConditionOperator.NotLike, &lt;span style="color: #a31515"&gt;"Hidden%"&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 8"&gt;                                                &lt;/span&gt;qe.Criteria.Conditions.Add(queryCondition);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 7"&gt;                                          &lt;/span&gt;&lt;span style="mso-tab-count: 1"&gt;      &lt;/span&gt;context.InputParameters.Properties[ParameterName.Query] = qe;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 7"&gt;                                          &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 6"&gt;                                    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 5"&gt;                              &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: " courier=""&gt;&lt;span style="mso-tab-count: 1"&gt;      &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: " courier=""&gt;}&lt;/span&gt;&lt;/p&gt;</description>
      <link>http://www.askcrm.com/Home/tabid/866/EntryID/73/Default.aspx</link>
      <comments>http://www.askcrm.com/Home/tabid/866/EntryID/73/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.askcrm.com/Default.aspx?tabid=866&amp;EntryID=73</guid>
      <pubDate>Tue, 11 Nov 2008 18:08:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.askcrm.com/DesktopModules/Blog/Trackback.aspx?id=73</trackback:ping>
    </item>
  </channel>
</rss>