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)

Only can filter lookup once in OnChane method javascript ?

(0) ShareShare
ReportReport
Posted on by 195

I have lookup field that filtered by option set, so i create onchange method on my option set field. It works fine at first, but i just realised that when i try to change my option set again, my lookup will always empty, do i need to add something to make it work ? or it just doesn't work like that 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi,

    You can set lookup null using below  code -

       Xrm.Page.getAttribute(LookupFieldName).setValue( null);

  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    You need to remove the previous filter using removePreSearch in order to make it work. When you add the filter it appends the condition so next time it check for previous condition as well as new condition so it may not be working.

    docs.microsoft.com/.../removepresearch

    Hope this helps.

  • Keysersozeey Profile Picture
    195 on at

    thanks didn't know that i need to use removepresearch for that, and if you binding anonymous function  you are unable to remove it.

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