CRM news and views from Simon Jackson

Sunday, February 07, 2010

CRM 4 Multi Entity Type Lookup

Create a single lookup on a CRM form that allows the user to select from multiple entity types. Download these two entities to see this in action.



The code is a class that you can implement, so it really should be easy to use. To use the class do the following steps:

On the entity that requires the multi entity type lookup:


  1. Add a N:1 relationship for each entity type that you want in the lookup.

  2. Add the look ups to the form, add one where you want the Multi Entity Type and the others to tab that we will hide from the user.


  3. In the onload paste in the class at the top:

  4. Call the class to setup the lookup



  5. Call the onsave method


  6. Please let me know if you find this useful by posting a comment.

Labels: ,

Adding a browse button (html input file control) to a CRM form

Here's a quick example of how to put a browse button (html input file control) on a CRM form and then populate another field when it changed. Put this into your onload and update the field name 'new_filepath' in the inputF_onChange method to the name of the field that you would to be populated with the full path.

inputF = document.createElement('input');
inputF.type = 'file';
inputF.onchange = inputF_onChange;

tbl = crmForm.all.tab0.getElementsByTagName('table');
if (tbl && tbl[0]) tbl[0].parentNode.insertBefore(inputF, tbl[0]);


function  inputF_onChange() {
if (inputF && inputF.value)
crmForm.all.new_filepath.DataValue = inputF.value;
}

Here's a list the members exposed by the input type=file object.
http://msdn.microsoft.com/en-us/library/ms535263(VS.85).aspx

It should be noted that the above example will not work for IE8 as JavaScript can no longer read the full path from the value property.

As an alternative I would recommend trying a more supported method, for example, create an ISV page with the input file control and read the path server side and use javascript to populate the control on the parent CRM form.

Labels: ,

Thursday, February 04, 2010

Microsoft CRM 4.0 Update Rollup 7 and "Internet Explorer has blocked this site from using an ActiveX control in an unsafe manner."

Rollup 7 adds a new “Configure CRM” button to setup the Outlook client. The button uses an ActiveX control to read your CRM Outlook client, which can causes IE to display "Internet Explorer has blocked this site from using an ActiveX control in an unsafe manner."

This occurs when you have the Microsoft Office Outlook installed but not configured, or if you are connecting to an organisation other than the organisation for which Microsoft Dynamics CRM for Microsoft Office Outlook is configured.


This issue is mentioned in http://support.microsoft.com/default.aspx/kb/976539


A solution is mentioned here http://support.microsoft.com/kb/2004601


You can either change the IE security zone on the client or update the registry on the server. To update the sever registry, follow these steps:

  1. Open Regedit
  2. Navigate to:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM
  3. A a new 32bit DWORD called DisableOutlookSetupLink
  4. Set the value to 1 to disable the CRM for Outlook button for all users.

Labels: ,

Wednesday, February 03, 2010

about:blank not always trusted, so not such a good default url for your CRM IFrame

Basically when setting a default page for your Crm Forms IFRAME about:blank can have a trust issues in the browser and it's better practice to use /_static/blank.htm instead.

This nice article from those ascentium guys explains why.
http://xrm.ascentium.com/blog/crm/Post612.aspx

Labels: