Technical Blog

Leveraging HTML Web Resources to show blocks of text in forms

In previous versions of Microsoft Dynamics CRM, whenever blocks of text needed to be displayed within forms, the system customiser had limited options. They could either use a section name to display text (this was however rather limited in terms of length and placement flexibility) or would need to resort to embedding a custom web page within an iframe. This was typically beyond the capability of most customisers and posed certain challenges when redeploying between environments. Microsoft Dynamics CRM 2011 allows us to add HTML web resources to forms and we can use these to seamlessly add text blocks wherever we choose. The below example shows a form that has an authorisation section that required some official wording placed above the secured fields. To achieve this, we need to first of all add a css web resource which contains the following line of text: body { font-family:Segoe UI; font-size:11px; margin:0px; background-color:F6F8FA; border:0px; } In the example, we have named our css web ...

Read the rest of entry »

Control Activate and Deactivate buttons by Security Role using a JScript web resource and enhancing the RibbonDiffXml

The security model in Microsoft Dynamics CRM 2011 is extremely flexible and with the inclusion of field level security, is almost ultimately configurable. However, there is a small deficiency in the security model whereby the ability to activate and de-activate records is not independently configurable. Several of our customers have expressed a desire to allow their users to write to a record but not allow the activation or de-activation. I have posted a product enhancement suggestion on Microsoft Connect here, but in the meantime, here is how to configure an entity to only allow users with a defined security role to activate or de-activate a record: A user may activate or de-activate records from list views and within the record’s form so we must enhance the RibbonDiffXml of our chosen entity to disable these buttons depending on the result returned by a JScript web resource which evaluates the user’s security role. The following example will disable the activate and de-activate ...

Read the rest of entry »

Displaying Data From a Parent Record on a Child Form Using an HTML Web Resource

A common requirement of users when viewing records such as contacts is to be able to see information which belongs to a parent record immediately on a child form so to eliminate the need to navigate up to the parent record. In CRM v4.0, an iframe in conjunction with an aspx page was needed in order to display such information and this would frequently be outside the capabilities of the system customiser. With the introduction of HTML web resources in CRM2011 we can use these in conjunction with jscript to display values from fields contained in a parent record. The header section is a nice feature in CRM2011 but it is rather limited in terms of formatting and if you are not careful, adding three or four fields vertically can quickly use up a lot of screen real estate. By using the HTML web resource, we can fit more information in a smaller amount of space. The screenshot shows an example where we have added 3 html web resources to the header in order to give the user immediate visibility of ...

Read the rest of entry »

Customising the ‘Sample Data’ in CRM2011 (on premise)

The ‘Sample Data’ feature in CRM2011 is a very handy tool for quickly populating an organisation in anticipation of a sales demonstration. However, it is always nicer for the potential customer to see more meaningful data, especially for fields that can be localised such as telephone numbers and address information. It is possible to amend/enhance the sample data as these files are stored on the CRM application server. These files can be found in the following folder by default: C:\Program Files\Microsoft Dynamics CRM\LangPacks\1033\SampleData Enhance each Excel xml file accordingly.. .. then run the ‘Sample Data’ feature again to import your customised sales demo data. It is worth noting that these files are deployment wide in context so by amending them, all organisations in your deployment instance will use these. Also, if you have multiple application servers, be sure to amend the files in on each application server. Be sure to take a backup of these files jus ...

Read the rest of entry »

CRM 2011 / v4.0 Excel Dynamic Pivot Table Export Problem – How to Fix

By default the setting within Microsoft Excel 2010 causes the export to dynamic pivot table functionality within Microsoft Dynamics CRM to fail.

This is caused by Microsoft Excel’s enhanced protection feature. When you select the ‘export to Excel’ option and choose Dynamic Pivot Table it create a .xls file in the following location C:\Users\>USERPROFILE<\AppData\Local\Microsoft\Windows\Temporary Internet Files, this  location is considered unsafe by Microsoft Excel ‘s enhanced protection feature.

To resolve this issue please follow steps below.


1. Open up Microsoft Excel 2010

2. Select File and point to Options

3. Select Trust Centre from the left hand side

4. Click Trusted Centre Settings

5. Select Protected View

6. Un-tick the second option, Enable Protected View for files located in potentially unsafe locations

7. select Ok twice

Maximise a form in Microsoft CRM2011

The following was a handy piece of jscript commonly used in CRMv4.0 and CRMv3.0 to maximise a form to use the entire screen;

window.resizeTo(screen.availWidth, screen.availHeight); 

However, in Microsoft CRM2011, this has changed slightly and you must add ‘.top’ to your jscript web resource:,0);, screen.availHeight);

This can really help the end user reduce the number of mouse clicks and gives the maximum amount of screen real estate from a system customiser perspective.

Firing a dialogue from an event

Firing a dialogue from an event In Microsoft Dynamics V4 it was possible to fire a workflow from an event or isv button and with the arrival of dialogues, I thought it would be neat to be able to trigger dialogues from an event (either onload, onsave or onchange of a tab or field). Here’s how it’s done in Microsoft Dynamics CRM2011. The following example fires a dialogue when a record is modified. This could easily be modified to fire in different form scenarios or on evaluating a particular field using the ‘if’ condition. Create a web resource of type JScript and add the following code: function FireDialogue() {           var CRM_FORM_TYPE_CREATE = 1;      var CRM_FORM_TYPE_UPDATE = 2;      var sUrl = "";     var crmFromType = Xrm.Page.ui.getFormType();     if(crmFromType == CRM_FORM_TYPE_UPDATE)      {          var _ ...

Read the rest of entry »

CRM testing and ‘In Private Browsing’

When testing Microsoft Dynamics CRM and the tester needs to evaluate security roles, the tester will typically use different credentials to log in as users who have different security roles associated with them. It is common for the tester to set their IE User Authentication settings to ‘Prompt for user name and password’ so that as they open a browser session, they can log in to Microsoft Dynamics CRM with different credentials. However, this doesn’t always prompt the user to log in and sometimes the cache & history have to be cleared in order to force the log in prompt. A useful tip in this scenario is to make use of the ‘InPrivate Browsing’ feature in IE8 and above. If no other ‘In Private’ browsing sessions are active, opening a new one always prompts for credentials. This allows the Microsoft Dynamics CRM tester to happily have two web client sessions open (one normal and one In Private) which they can use to compare side by side different users with ...

Read the rest of entry »

CRM 2011 Dynamic Web Resources using JScript

The concept of web resources in CRM2011 is really exciting and the option to store gif and jpeg images as web resources gives us a new opportunity in making form design graphically more informative and compelling. The following example shows how we can utilise web resources and jscript to make images embedded on forms dynamic so that the user can be presented with different images depending on data values held within a record. Here is an example that uses a pick list value to control the web resource that appears on a form. This simple example could be used to display a warning sign if a customer is unhappy. Firstly, add a pick list to your form and also add a web resource. Use the ‘New Field’ function within the Field explorer to quickly create a new field. Note the numeric value you assign to your picklist option as you will need this in the evaluation part of the jscript. Here, ‘Warning’ has a value of 2. Create a couple of web resources of type gif or jp ...

Read the rest of entry »

Microsoft CRM 4.0 Rollup 14 Available

Microsoft released update rollup 14 on 16th November 2010 for Microsoft Dynamics CRM 4.0 (KB 2267499).

You can download it at the following location,

The KB article contains the installation instructions and list of fixes.
Pages: 123NextReturn Top
Home   |   About Us   |   Dynamics CRM   |   Solutions   |   Services   |   Technical Blog   |   Contact Us
Copyright 2011 Gap Consulting DotNetNuke Website by Cantarus