web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

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

I have the same question (0)
  • Christophe Soyer Profile Picture
    on at
  • Community Member Profile Picture
    on at

    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.

  • Community Member Profile Picture
    on at

    Update:  It is working in Chrome

  • Christophe Soyer Profile Picture
    on at

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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans