Home | Contact Us

Powered by Blogger

Monday, February 18, 2008

Pseudo-Filtered Lookup Dialog in Microsoft Dynamics CRM 4.0

One of the great unsupported customizations in Microsoft CRM 3.0 was the ability to apply a filter to a lookup with just a few lines of JavaScript.  Ronald Lemmen had a nice post describing this approach that used a FetchXml query to filter the lookup values.  However, in Microsoft CRM 4.0 this customization no longer works and when you attempt it you receive the following depressing error:

CRM Parameter Filter - Invalid parameter 'fetchXml=...' in Request.QueryString on page /_controls/lookup/lookupsingle.aspx

Figuring Microsoft must have renamed the parameters I spent some time today scanning the Microsoft CRM DLL files (Lutz Roeder's Reflector for .NET is a great tool for reverse engineering).  Unfortunately I came up dry and have come to the conclusion this approach no longer works.  Hey, it was unsupported in the first place -- can't really complain ;-)  Since filtering is such an important feature of usability we still wanted to find a way to apply a filter to lookups.  In our world we have relationships where entity names are not always unique across the organization, though they are unique within the context of their parent relationship.

Of the query string parameters still available one still gave promise of a possible solution - search.  When this parameter is specified it defaults the search string in the lookup dialog and applies the search when the dialog is opened.  While we are not able to target our filter to a specific field, we can still leverage the lookup search (and the search columns for the lookup view) to filter the records returned.

For this example assume we have two entities - state and city - with the state being the parent of city.  In the City Lookup View add a find column for the state name:

image

In the onload event of the form we add the following:

document.FilterLookup = function(source, target)
{
    if (IsNull(source) || IsNull(target)) { return; }

    var name = IsNull(source.DataValue) ? '' : source.DataValue[0].name;

    target.additionalparams = 'search=' + name;
}

In the onchange event of the state field on the form we add the following:

document.FilterLookup(crmForm.all.awx_stateid, crmForm.all.awx_cityid);

When the user selects a state...

image

... and then chooses a city, they see this:

image

Filtered?  Yes!  Supported?  Maybe not, but should be good until 5.0 :-)

Labels: , ,

Saturday, February 02, 2008

AdvantageWorks Beta for Microsoft CRM 4.0 (correction)

The previously listed email address for submitting requests to participate in the beta program was incorrect and should read as follows:

If you are interested in being considered as a potential AdvantageWorks beta tester, please send an email to support@advantageworks.com.  Please include information about your company, development environment, type of deployment (on premise, hosted, or live), and a primary contact.

Labels: , , , ,

Using Nurture Marketing and CRM in Commercial Real Estate

Ascendix Technologies will be sponsoring the TCN West Region Conference in Reno Nevada on February 28th and 29th. Wes Snow, President and CEO of Ascendix Technologies, will be presenting a seminar targeted for brokers where he will discuss the concept and philosophies of nurture marketing and how brokers can apply these simple principles to make a significant impact on their effectiveness and earning potential.


Labels: ,

Copyright © 2007 AdvantageWorks Software Group, LLC. All rights reserved.