Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Triger Javascript on lookup field change event

Posted on by 130

Hi - I have two lookup fields Category and Sub category. I want to use javascript on my form on field change event. So if I change a value in Category it should reset subcategory value to blank. Any help please? Thanks

  • ilyasmo Profile Picture
    ilyasmo 130 on at
    RE: Triger Javascript on lookup field change event

    So it's done now using javascript.

    1- create javascript file in web resources

    2- call the function on lookup field change event

    here's code snippet

    //this function reset subCategory value on Category lookup change event

    function fuction() {

    Xrm.Page.getAttribute("fieldtoresetvalue").setValue(null);

    }

  • ilyasmo Profile Picture
    ilyasmo 130 on at
    RE: Triger Javascript on lookup field change event

    Hi Bipin, BR don't work when I click on search icon. It is a lookup field. If I change the value in category field then it works but if I click on search icon in category field then it doesn't work.

    Thanks

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Triger Javascript on lookup field change event

    Hi,

    You Can achieve this with the help of Business Rule. Why do you want to write JS code for this?

    Regards,

    Bipin

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans