Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Remove hard-coded behaviour when using lookup classes

0 views
Skip to first unread message

Michael Hoehne

unread,
Apr 10, 2006, 8:33:01 AM4/10/06
to
In CRM 3.0 we're currently unable to modify the items displayed in a lookup
window. I looked into the JavaScript implementation and thought that we
should be able to provide custom lookup filters through adding a new xml file
in the <program files>\Microsoft CRM\Server\ApplicationFiles folder. However
specifying a *new* lookup class always leads to a FileNotFoundException. I
finally had a look at the CRM assemblies and found that this is hard-coded in
the GetLookupXml function (I'm not going into more detail here).

Without this restriction we could use the following very simple addition in
an onLoad event of a CRM form:

var oLookup = crmForm.all.primarycontactid;
oLookup.lookupclass="stunnware_MyAccountView";
oLookup.AddParam("stunnware_accountid", crmForm.ObjectId);

This overwrites the standard lookup class and adds an additional parameter
to only display the contacts associated with the current account. The only
thing needed to make this working is to remove the hard-coded behaviour
comparing against a list of 69 predefined lookup classes. It won't break any
functionality but would allow us to easily modify the displayed items in the
lookup dialog.

Ideally, we will find the lookupclass and maybe the parameters in the form
designer and/or the attribute defintiion, whatever makes more sense.

Thanks
Michael
--
http://www.stunnware.com/crm


----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.mspx?mid=3695e5d9-4d6f-4add-a97d-90bb78ff0bc7&dg=microsoft.public.crm.developer

0 new messages