Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM 2015 SP1 Carina - Custom filters on lookups

(1) ShareShare
ReportReport
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

  • Christophe Soyer Profile Picture
    on at
    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
    on at
    RE: CRM 2015 SP1 Carina - Custom filters on lookups

    Update:  It is working in Chrome

  • Community Member Profile Picture
    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.

  • Christophe Soyer Profile Picture
    on at
    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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
dkrishna Profile Picture

dkrishna 6

Featured topics

Product updates

Dynamics 365 release plans