Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

Disable statecode selection (notremoving)

Posted on by 219

Hello,

for our salesorder Entity we are trying to disable some statecode options from the dropdown field with javascript. We dont want to remove them. The problem with removing is, that it looks like an empty field when its selected via ribbon button.

Why we want to do this? When we remove the option it is (and needs) still to be clickable in the ribbon.On the ribbon are the standard buttons(from Microsoft) to change the state.These are the buttons with the close dialog

The Main problem is that some states are needed to be set via ribbon button and others via the dropdown on the formular. and we want to hide the ribbon options in the dropwdown of the formular. Because these ones throwing an error.

any Ideas?

  • Nya Profile Picture
    Nya 29,056 on at
    RE: Disable statecode selection (notremoving)

    Hi,

    It's great to hear that the issue has been solved and thanks for the query.

  • McDauly Profile Picture
    McDauly 219 on at
    RE: Disable statecode selection (notremoving)

    Hello I wanted to disable it like make it grey and not clickable. when you remove it completely from the dropdown and set it via ribbon you see just '---' in the dropdown...

    But I solved it with a workaround. I now remove the statuscodes and add the again.

  • Nya Profile Picture
    Nya 29,056 on at
    RE: Disable statecode selection (notremoving)

    Hi,

    I have tested to hide the options with the following JavaScript:

    Xrm.Page.getControl("statecode").removeOption(3);

    It will not be shown as an empty field.

    Or you may mean that you'd like to remove all the options and then it will show the Select only.

    pastedimage1628844107892v1.png

    Would you please attach some screenshots to describe your issue more clearly?

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans