Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

CRM 2015 SP1 Carina - Custom filters on lookups

Posted on by

Hello,

On CRM 2015 I was able to define custom filters on lookups  with th followinf JS (for example) :

function OnLoad() {
 Xrm.Page.getControl("regardingobjectid").addPreSearch(PreSearchIncident());  
 
}

function PreSearchIncident() {
 
 var RegardingFilter = "<filter type='and'><condition attribute='incidentid' operator='not-null'/></filter>";
     document.getElementById("regardingobjectid_i").setAttribute("defaulttype", "112");
        document.getElementById("regardingobjectid_i").setAttribute("lookuptypes", "112,1,2");
 Xrm.Page.getControl("regardingobjectid").addCustomFilter(RegardingFilter, "incident");
}

It worked well.

But today on CRM 2015 SP1(Carina) it doesn't work anymore.

Has someone any ideas in order to meet the following requirements:

 - Regarding Object : by default incidents

 - To : Only Contacts

Thanks a lot in advance for your help.

Christophe

*This post is locked for comments

  • RE: CRM 2015 SP1 Carina - Custom filters on lookups

    Thanks all for your answer. But as it is unsupported, as Guido said, I think we should not use this command.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: CRM 2015 SP1 Carina - Custom filters on lookups

    Update:  It is working in Chrome

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: CRM 2015 SP1 Carina - Custom filters on lookups

    I was able to get document.getElementById(..) working in Carina for a different situation by adding "parent." such as this:

    parent.document.getElementById(..)

    It seems to work in IE10 (fine for our users) , but it does not work in Chrome, so it is only a partial solution.

  • RE: CRM 2015 SP1 Carina - Custom filters on lookups

    I found this... but not really meet my needs :

    http://community.dynamics.com/crm/b/microsoftdynamicscrmco/archive/2015/06/01/microsoft-dynamics-crm-2015-update-1-lessons-learned-part-iv

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans