Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Option set field required - auto expands

Posted on by Microsoft Employee

In CRM 2016 on premise version 8.0.1.97  - upon clicking a custom button we have an option set field set to required. This causes the option set to expand to show the list of potential values.  If no value is chosen upon save a notification error appears as expected. However the message cannot be read because the option set is expanded. Is there a way to close the option set or collapse it while required ? In 2011 it would just be highlighted with a first blank value

*This post is locked for comments

  • Verified answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Option set field required - auto expands

    Yes Ravi  you are correct , although the message is not visible under control  but its showing in the below right  corner , see the attached screenshot - 

    2018_2D00_12_2D00_17_5F00_11_2D00_07_2D00_38_5F00_optionset.png

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Option set field required - auto expands

    Hi,

    If I am not wrong, the same message appears in the save icon bottom right corner. So even if it is not visible, users will not be able to save the record and will be presented with the same error message near the save icon.

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Option set field required - auto expands

    Hi R T,

    You can do following Workaround , setFocus wont be help in this case , seems setFocus internally calling  while set the control notification and expanded optionset fields.

    - Set Form Notification instead of control notification.

    OR 

    - Set the Optionset default value if its mandatory then , instead of setting null.

    2018_2D00_12_2D00_15_5F00_11_2D00_39_2D00_19_5F00_dd.png

    OR

    - Set optionset value using JS .

  • Suggested answer
    Sreevalli Profile Picture
    Sreevalli 3,256 on at
    RE: Option set field required - auto expands

    Hi,

    After making Optionset field as mandatory, set the focus on next field so that option values will be collapsed

    Xrm.Page.getControl(AttributeName).setFocus();

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans