Link to home
Start Free TrialLog in
Avatar of BigBlueMan
BigBlueManFlag for United Kingdom of Great Britain and Northern Ireland

asked on

CRM 4.0 Filtering Lookup For Records Lookups

Hi

Got a question regarding filtered lookups in CRM.. What I'm trying to achieve is when a user opens a Campaign Response record, they click on the lookup for the relating Campaign record. In the list of campaigns that come back, I want to show all except those ones that have been Cancelled.

Now there are loads of blogs, web sites, etc.. giving solution to this problem. One I picked on was at;

http://crm.georged.id.au/post/2008/02/16/Filtering-lookup-data-in-CRM-4.aspx

Now, I followed that example and did all steaps outlines.. I created my version of the piece of code below and placed it in the onLoad() event of the Campaign Response.

Doesn't work... Am I missing something completely here ?


var field= crmForm.all.regardingobjectid;
    field.lookupbrowse = 1; 
    
    // Pass fetch xml through search value parameter 
    field.AddParam("search", 
      "fetchXml=<fetch mapping='logical'><entity name='campaign'>"
       + "<all-attributes/><filter type='and'><condition attribute='statuscode'"
       +" operator='ne' value='4' /></filter></entity></fetch>");

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of pbergen
pbergen
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BigBlueMan

ASKER

Hi pbergen

I was looking for a quick free solution, but am aware of the stunnware implementation. Thanks anyways for replying..

sorted thanks