Skip to main content

Notifications

Customer Service forum

MultiSelect field - clearOptions() NOT clearing selected options

Posted on by 60

Multi-Select Option Set does not clearing selected options

if i give Xrm.Page.getAttribute(“new_testmultiselect”).setValue(null)

it gives an error 

One of the scripts for this record has caused an error. For more details, download the log file.
Error: parameter is not passed or parameter is nNull or undefined at Function.Error.create 

Categories:
  • Suggested answer
    Adrian Begovich Profile Picture
    Adrian Begovich 21,009 Super User 2024 Season 2 on at
    RE: MultiSelect field - clearOptions() NOT clearing selected options

    Hi Muhammad Bilal,

    Have you considered adding and removing options from the field customisation screen?

  • Bilal079 Profile Picture
    Bilal079 60 on at
    RE: MultiSelect field - clearOptions() NOT clearing selected options

    Hi Ben,

    Thanks for your response,

    i have already looked this solution. but my issue is, i want to remove all selected and unselected options and add new ones. Options can be removed but the selected values still remain in the Multiselect Input, when i click on Multiselect, it shows nothing in the drop-down but after closing the drop down the previously selected values appear again there.

  • Suggested answer
    Ben Thompson Profile Picture
    Ben Thompson 6,350 on at
    RE: MultiSelect field - clearOptions() NOT clearing selected options

    It's worth looking at https://community.dynamics.com/crm/b/vikranthpandirihowtoseries/archive/2017/11/04/dynamics-365-v9-0-set-multi-select-option-set-values-using-jscript for how to add and remove values in a multi-select optionset.

    Note that all the examples use formcontext rather than Xrm.Page as multi-select optionsets are new functionality and Xrm.Page was deprecated...

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans