Posts

Showing posts from 2011

The Flying W by Glenn Wilson

My Wife Anne Marie and I had a great vacation in Philly this weekend with my Mom.  We stopped by Weidener University on Saturday and took some panoramic photos of a sculpture that my Grandfather, Glenn Wilson, designed for the school called The Flying W.

Xrm.Page.ui Not Available on Primary Grid

Image
  While developing an EnableRule for some new functionality I decided to use an Async call.  Here is a great link on how to use Async calls with EnableRule. http://myencounterwithcrm.wordpress.com/2011/06/09/walkthrough-of-asynchronous-call-from-customrule-ribbondiff/ Microsoft even notes this strategy in the SDK documentation:  Consider that Microsoft sees this as the “proper way” to do things you might think that they would provide the necessary methods to complete this, that would only be half correct. All of this works if you are on an entity form because Xrm.Page.ui.refreshRibbon() is available.  Unfortunately if you are in a grid such as the one displayed below, Xrm.Page.ui is null, which means you cannot call the refreshRibbon() method. DAGGER!!!!!! If anyone knows a way in which to get around this please leave a comment

GetPickListProperty.name Returns Null in PreCreate

In CRM 4.0 using the Target.GetPickListProperty("fieldname").name property would return the string value of the pick list item display name even in a PreCreate plugin step.  Apparently though in 2011 the name property just returns null until after the initial create has been done.  Instead of using name make sure to use the Value property which is always available. mypicklist Example: Value  Name 1         Approve 2         Cancel PreCreate step: Target.GetPickListProperty("mypicklist").name  // this would return null Target.GetPickListProperty("mypicklist").Value // this would return either 1 or 2 PostCreate step: Target.GetPickListProperty("mypicklist").name  // this would return either "Approve" or "Cancel" Target.GetPickListProperty("mypicklist").Value // this would return either 1 or 2

Plugin Set to Use Offline but Entity Offline Settings Not Configured

Image
While attempting to deploy a solution to CRM 2011 I received the following error during the import. 0x80040203 - Supported deployment does not agree with message availability After reviewing the code for the plugin I realized that it was attempting to register the plugin for both Server and Offline. [System.ComponentModel.AmbientValue("CrmPluginStepDeployment=2")] The problem there was that the Entity was not set for Offline mode. One the entity was updated the solution installed correctly.

CustomRule - Just one at a time please.

When you define a CommandDefinition in the CRM 2011 and you want to use a CustomRule underneath an EnableRule just remember that your CustomRule will never fire if you have other EnableRules applied to that Command Definition.  This means that you can't use a bunch of the already build in EnableRules on top of your CustomRule.... which sucks.  Instead you need to re-create the functionality in your CustomRule javascript. For example you can't just use the Mscrm.SelectionCountExactlyOne rule to determine if there is only one record selected in a grid.  Instead you have to do the following; Pass in the CrmParameter called SelectedControlSelectedItemCount and then check to make sure that parameter equals one in your JS code. I really don't like the ribbon schema.  It's confusing and the rules that apply to buttons you create don't always seem to apply to the ones that come out of the box, which makes it extremely hard to troubleshoot sometimes just using the output ...

Web.Config Modification Manager Update

So this is an update of a solution from Harmjan Greving which was an update from thekid.me.uk which can be used to view, modify, and create web.config modification that will be pushed to all servers within the farm. The only changes I made from Harmjan's version was to fix some problems when loading modification which contained double quotes.  They were causing the page to load improperly.  Also for the current modification table I added a number field as the first column so that when I'm talking to customers over the phone they can tell me the number of mods or easily reference individual items. To use it just download the webconfig.aspx page. Then drop it in the 12 hive at, C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\ADMIN. The page can be accessed through, http://CA:PORT/_admin/webconfig.aspx

SharePoint 2010, Event ID 7043: Could not load type 'Microsoft.SharePoint.Portal.WebControls.TaxonomyPicker'

Image
PROBLEM: Every time the application pool is reset the following error appears in the application log. Load control template file /_controltemplates/TaxonomyPicker.ascx failed: Could not load type 'Microsoft.SharePoint.Portal.WebControls.TaxonomyPicker' from assembly 'Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'. ORIGINAL SOLUTION:   It appeared at first that the problem was with a HTML encoded ',' in the assembly reference of the file which I changed by editing the TaxonomyPicker.ascx file. You can see here that the ',' character has been encoded into ,   Below you can see the correct way in which the reference should be done. UPDATED SOLUTION:  The above updates stopped working and the next time an IISRESET happened the error came back.  After doing some research it appears that the TaxonomyPicker is never actually used.  To finally remove the error I just renamed the file to Taxonomy...

User Rights Issues in CRM using JavaScript

I needed to find a way to determine if a user did not exist in CRM or did not have any rights. The devError page is available in both CRM 4 and 2011 and returns the same errors. Also for this to work correctly the user must be in the same domain as CRM and the CRM site url must be in trusted or local intranet sites and passing the authentication automatically. $.ajax({ url: data.serverurl + '/_common/error/devError.aspx', success: function (data) { if ($('div pre:contains("[CrmException: No Microsoft Dynamics CRM user exists with the specified domain name and user ID")', data).length > 0) { accessError = true; } else if ($('div pre:contains("[CrmException: The user is not assigned any privileges....

Passing Parameters Between Web Part and User Control

Image
When creating a web part which encapsulates a custom user control the following is one way to utilize the custom attributes for the web part within the user control. First find the class name of the user control in the code behind of the user control page. User Control Code Behind - Class Name Define a web part property in your web part code.  In this case I want users to enter a URL which I will use to load an iframe within the control. Web Part Code - Property Definition Next when creating your user control in the web part code make sure to specify the type of the control you are going to add as the class of your user control.  Then you can add attributes to the control which will be accessible when the user control loads. Web Part Code - CreateChildControls() Finally you can access the attributes you have added to the control from the code behind on the user control.  In the example below I am retrieving the ViewURL in the user control Page_Loa...

System.ServiceModel.EndpointNotFoundException in OWSTIMER.EXE

Image
I started getting this error every five minutes after the timer service would kick off. An Unhandled exception ('System.ServiceModel.EndpointNotFoundException') occurred in OWSTIMER.EXE Turns out that the error was due to the Forefront Identity Manager Service not being started.  After starting the service the error goes away.

CRM 2011 Publisher Policy / Redirection

While working on a CRM 2011 application I kept getting the following error even though I was not even using the CRM 4.0 SDK file. Exception information: Exception type: FileLoadException Exception message: Could not load file or assembly 'Microsoft.Crm.Sdk, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) To get around the problem I put the following redirection binding to the CRM 2011 SDK in the web.config. This runtime info can go anywhere directly underneath the configuration node. <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Microsoft.Crm.Sdk" culture="neutral" publicKeyToken=...

Clear IE Cache Through Command Line

Apparently you can clear the IE cache using the command line.  This is going into batch files to reduce the number of times I have to click in IE. All , RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255  History , RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1 Cookies , RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2 Temp Internet Files , RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8 Form Data , RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16 Passwords , RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32

Come Out and See Anne Marie in [title of show]

Image
My lovely wife Anne Marie will be performing in [title of show] at The Little Theatre of Alexandria from April 23-May 14.  If you can make it out to support her I would appreciate it.  I'm planning on attending Easter Sunday, hope to see you there. [title of show] Directed by Michael Kharfen Music and lyrics by Jeff Bowen Book by Hunter Bell April 23–May 14, 2011 [title of show] is a unique and quirky musical about two guys who write a Broadway musical about two guys writing a Broadway musical. With a couple of their actress friends, they journey from the unemployment line to the bright lights of Broadway. Don’t miss the show that The New York Times called “...genial, unpretentious and far funnier than many of the more expansively manufactured musicals that make it to Broadway.” This is a 21st century update of “putting on a show” clever songs and witty dialogue. (Strong Language)

CRM 2011 Ribbon XML Tips

SharePoint 2010 uses the same ribbon xml schema and there are a lot of resources which are also applicable to CRM 2011. So if a google search using 'CRM 2011 Ribbon' doesn't work try 'SharePoint 2010 Ribbon'. In order to determine sequence numbers you first need to determine the sequence of items currently on the form. You can do this using a tool in the SDK which will allow you do download the ribbon definitions for all of the entities. C:\CRM SDK RC\samplecode\cs\client\ribbon\exportribbonxml\  NOTE:If you have Many to Many relationships within your custom entities make sure to update the SDK ExportRibbonXML utility to look enture the IsIntersect property is false or the export will fail. //<snippetExportRibbonXml5> //Check for custom entities RetrieveAllEntitiesRequest raer = new RetrieveAllEntitiesRequest() {EntityFilters = EntityFilters.Entity}; RetrieveAllEntitiesResponse resp = (RetrieveAllEntitiesResponse)_serviceProxy.Execute(raer); fo...

Global Context for CRM 2011

When creating htm pages as webresources in 2011 there are many times you would want to get information about CRM such as the orgname and server url.  This is where the ClientGlobalContext comes in to play. <script src="ClientGlobalContext.js.aspx"></script> Remember that if the web resource name has a folder name(s) before it you must include preceding "../" in front of the script name. Example 1: Webresource Name: mycust_/test.htm Script reference: <script src="../ClientGlobalContext.js.aspx"></script> Example 2: Webresource Name: mycust_/elements/test.htm Script reference: <script src="../../ClientGlobalContext.js.aspx"></script> By adding this reference into your htm file you will now have access to several javascript functions: getAuthenticationHeader: Returns the encoded SOAP header that you need to use Microsoft Dynamics CRM 4.0 Web service calls using Jscript. getOrgLcid: Return...

iPhone Jailbreak Software

TinyUmbrella Backup SHSH Blobs http://thefirmwareumbrella.blogspot.com/ f0recast Check if your device is unlockable or Tethered with just a simple USB connect iREB Put your device into a jailbreakable state. sn0wbreeze 2.2 A Custom IPSW Creator. http://ih8sn0w.com/index.php/products/view/f0recast.snow

Hibernation Mode With Windows Server 2008 and Hyper-V

On occasion I need to run Hyper-V for testing on my laptop.  Most of the time though I would love to have the power management function such as hibernation which is disabled by Hyper-V.  In order to get around this I have updated the following registry key which disables Hyper-V on startup. [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\hvboot]"Start"=dword:00000003 Now when I want to run Hyper-V I just click on a .bat file on my desktop which contains the following commands.  net start hvboot net start vmms net start nvspwmi net start vhdsvc PAUSE Now that you have enabled Hyper-V the power management features will no longer be available until you reboot the system.  This isn't exactly a fix but it's a great workaround.

RunAs Another User from Context Menu

Image
If you would like a quick way to run programs as another user there is a utility from Sysinternals called Shell RunAs.  This utility will allow you to access the RunAs command from a context menu. http://technet.microsoft.com/en-us/sysinternals/cc300361.aspx