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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to add and remove values from Optionset dropdown

(0) ShareShare
ReportReport
Posted on by 485

Hello,

I want to show or hide values based on some condition but once value is removed not able to show value again in selection.

iam able to remove value with this line   Xrm.Page.getControl("new_models").removeOption(100000000);

But value is removed can we add value again ? is there any other way to just hide value instead of removing value from optionset ?

Thanks,

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mahendar Pal Profile Picture
    45,095 on at

    Hi,

    You can re add them back using the same index value, This link still should help you:

    vasubabumscrm.blogspot.com.au/.../addremove-optionset-value-at-run-time.html

    msdn.microsoft.com/.../gg334266.aspx

  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Hi dkrishna,

    There is no way to just show or hide values in an optionset. You can only remove and add items as previously mentioned.

    Have you considered the possibility of using filtered lookup controls instead.

    With lookup you can have the selection of a second lookup be based on the selection of the first.

    An example would be if you have a lookup containing States, and a second lookup containing Cities and States.

    You would be able to select the State in the first lookup, and then the second lookup would only show the Cities based on the State that you selected.

    Logic is called Filtered Lookups, and is a great approach for something like this.

    You also have an option of using Dependent Optionsets if that works for you.

    crmoptionsets.azurewebsites.net

    Hope this helps.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans