Twitter Image

Passing Values to Forms in MSCRM 2011 and 4.0

Tuesday, 03 May 2011 10:03

In CRM 2011, you can include arguments in the extraqs parameter to set field values. The following requirements must be met:

  • You must encode the parameters passed in the extraqs parameter. Use encodeURIComponent to encode the parameters.
  • The names of the query string arguments must match or include the names of attributes for the entity.
  • Lookup fields must use the suffix 'name' with the attribute name to set the text to display.
  • Lookup fields must use the suffix 'type' with the entity name to set the type of record that is displayed in the lookup.
  • The values passed must be valid.
  • The value cannot be a script.
  • For Boolean fields, use either an integer value of 0 or 1, or a text value of true or false to set the value.
  • For DateTime fields, use the text value of the date.

Here's a sample Javascript opening a new account form and defaulting the name to 'My Account'
window.open("/main.aspx?etn=account&pagetype=entityrecord&extraqs=" +encodeURIComponent("name=My Account"), "_blank", "location=no,menubar=no,status=no,toolbar=no", false);

You can find more examples in the CRM 2011 SDK

Note:

Any attempt to pass an invalid parameter or value will result in an error "InvalidOperationException: CRM Parameter Filter - Invalid parameter"
If you have custom parameters (ie: not a standard MSCRM parameter) that you want to include into the form querystring, you can configure the form to accept custom parameters, via the Form properties or directly in the Form generated XML.
You can find a detail procedure in the 'Configure a Form to Accept Custom QueryString Parameters' article of the CRM 2011 SDK.
The Registry change described here below for  MSCRM 4.0, still works in MSCRM2011, but is not a best practise. At best, it could be used temporary after an upgrade from MSCRM 4.0

In CRM 4.0, to pass field values to a form; the following requirements must be met:

  • The names of the query string arguments must match or include the names of attributes for the entity.
  • Lookup and Customer lookup fields should use the suffix 'name' with the attribute name to set the text to display.
  • Customer lookup fields must use the suffix 'type' with the attribute name to set whether the reference is to an account or a contact.
  • The values passed must be valid.
  • The value cannot be a script.
  • For Lookup fields, include an additional parameter to set the name to be displayed in the lookup. The name of this parameter is the attribute name + 'name'. For example, the Parent Account field in the Account form requires a parameter of 'parentaccountidname'.
  • For Customer lookup fields, the type of record must also be set. The name of this parameter is typically the attribute name + 'type'. For Customer lookup fields the value may be either 'account' or 'contact'. For example, the Parent Customer field in the Contact form requires a parameter of 'parentcustomeridtype'.
  • For Boolean fields, use either an integer value of 0 or 1, or a text value of true or false to set the value.
  • For DateTime fields, use the text value of the date.

Here's a sample Javascript opening a new account form and defaulting the name to 'My Account'
window.open("/sfa/accts/edit.aspx?name=My Account", "_blank", "location=no,menubar=no,status=no,toolbar=no", false);

You can find more examples in the CRM 4.0 SDK

Note:

  • This technique works for all entities except Activity entities (for those, see below comment by Andreas Cieslik)
  • Any attempt to pass an invalid parameter or value will result in an error.

In order to allow passing an invalid parameter (ie: a parameter not actually being a field), you have to create a new registry key in HKLM\Software\Microsoft\MSCRM\DisableParameterFilter (DWORD) and set it to 1. Of course, this is only doable on a On Premise or (Virtual) Private Cloud Installation.

Weekly Digest 27/4/2011

Wednesday, 27 April 2011 10:55

As I was off last week, here's a weekly summary.

Office 365 has gone beta, you can register on http://www.microsoft.com/en-us/office365/online-software.aspx, Microsoft CRM Online is not part of the offer, but the rumor mill is aiming in that direction...

The well known CRMDiagTool has been released for CRM 2011, here's a download link.

The CRM Team has some interesting articles with a Performance Checklist (from experience the connections registry settings are especially important), Recurring Appointments and a SOAP Library for Silverlight

The CRM Uk Blog has an article on running CRM 4.0 client/Outlook 2003 on CRM 2011 (as it's a supported configuration for migration) 

If you receive an error “Internet Explorer cannot display this feed” while connection the REST endpoint, Sven has a solution for you.

Leon Tribe has an interesting article on CRM Evolutions from the Forrester studies 

Daily Digest 14/4/2011

Thursday, 14 April 2011 12:52

The CRM 2011 Rollup 1 will be part of Windows Update on April,26th,  so take extra steps if you don't want it installed. At the time of writing, no major bugs have been found in UR1, while a lot are fixed, so it may also be a good time to upgrade.

When connecting CRM 2011 online, if you get the exception Unhandled Exception: "System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party", here's the solution.

If you are concerned about the security of your data in the public cloud, here's an interesting article about the UK Police using a private cloud for deploying Microsoft CRM.
By the way, Travi@ta has teamed with Belgacom to offer secure Microsoft CRM private clouds solutions in Belgium, you can find more information on http://www.belgacom.be/crm or direct contact info here.

Developing on CRM 2011 with Windows XP

Wednesday, 13 April 2011 10:24

I got a question today about developping to CRM 2011 from a XP workstation,

A quick look to the SDK (http://msdn.microsoft.com/en-us/library/gg328350.aspx) lists XP as un unsupported platform for the 2011 endpoint and (more interesting) the reason why

"The following is a list of the types of actions that are not supported:

Development using the Microsoft Dynamics CRM 2011 assemblies (specifically, Microsoft.Xrm.Sdk.dll) is not supported on Windows XP due to a dependency on Microsoft.IdentityModel.dll. However, you can use the Web Services (WSDL) from XP. For more information, see Use the WSDL Endpoint."

Microsoft.IdentityModel.dll is part of the windows identity foundation which not supported/installable on XP, the list of supported OS is as follows :Windows 7;Windows Server 2003 Service Pack 2;Windows Server 2008 R2;Windows Server 2008 Service Pack 2;Windows Vista

I played a bit with the idea of using the ORCA tools to force the install to XP, but here's an easier way to make it work on XP (in an unsupported manner)

Note that this just a temporary workaround, if you develop against the CRM 2011 endpoint, I would strongly suggest using a more modern platform like a Windows7x64.

Daily Digest 11/4/2011

Monday, 11 April 2011 14:43

With the Release of the 5.0.3 SDK, the Team blog describes how to add JavaScript IntelliSense

Here's Sonoma Partners experience with their upgrade to CRM 2011

David Jennaway has made list of the different options available for upgrading Asp.net extensions to CRM 2011

<< Start < Prev 11 12 13 14 15 16 17 18 19 20 Next > End >>
Page 15 of 21