Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Filter Look up with Java Script

(0) ShareShare
ReportReport
Posted on by 330

I have a requirement to filter a look up based on relationships , have figured only java script can do this.

So in this scenario I have 3 entities, Events, Hotels and Rooms.

Hotels has many rooms and Hotels can have many events

A room can also have many events.

So on the event form I have two look ups one to Hotel and another to room .

So if I pick the hotel look up which is required.

I want to be able to only see the rooms associated to that hotel.

so Hotel has a sub grid for rooms where the rooms will be created.

SO on the event form i want to filter the look up on the room field to only display the rooms that were created for the hotel I chose.

Will appreciate any hint , I figured it will be Java script already.

Regards.

*This post is locked for comments

  • lawix10 Profile Picture
    lawix10 330 on at
    RE: Filter Look up with Java Script

    Thanks this helped a lot

  • lawix10 Profile Picture
    lawix10 330 on at
    RE: Filter Look up with Java Script

    This was nice and straight forward

  • Verified answer
    ntn32 Profile Picture
    ntn32 401 on at
    RE: Filter Look up with Java Script

    Hi,

    You can use the CRM OOB functionality

    Refer this link

    www.powerobjects.com/2016/03/15/how-to-use-dependent-lookups-for-dynamics-crm-201320152016/amp/

  • Verified answer
    David Jennaway Profile Picture
    David Jennaway 14,063 on at
    RE: Filter Look up with Java Script

    You can use either the addCustomFilter or addCustomView in JavaScript to do this. See https://msdn.microsoft.com/en-us/library/gg334266.aspx#BKMK_lookupControlMethods

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,253 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans