Skip to main content

Notifications

Announcements

No record found.

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

Field mandatory when there´s a specific value in option set field?

Posted on by 4
Hi! Didn't know how to set a reasonable Subject for this but in short:
Working in Dynamics 365 CE. Client wants a field with values:
null (default)
Yes
no

I've created a option set field with these values but instead of /null/ one of the values is simply /---/ which client is fine with. 


Field is supposed to be mandatory but users should not be able to save with the value /---/ (so they have to choose Yes or No). Is this possible to do Business Rules/without javascript?

Any other solutions that you would recommend? Change field type to Boolean and somehow set Null as default?

Sorry if question is stupid, new to this :)
  • Suggested answer
    Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Field mandatory when there´s a specific value in option set field?
    Hi Partner,
    If you want to use Javascript, you can refer to the following links:

    preventDefault() function: Cancels the save operation, but all remaining handlers for the event will still be executed.

  • Nilsbergstroom Profile Picture
    Nilsbergstroom 4 on at
    Field mandatory when there´s a specific value in option set field?
    Thank you Leah! The issue is exactly like you said that the system determines that the field is not empty when "---" value is filled in, I'll look in to a Real-time Workflow as a solution for my problem but I think a script would be the better way to solve this! 

    Open for other suggestions!
     
  • Suggested answer
    Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Field mandatory when there´s a specific value in option set field?
    Hi Partner,
    A business rule can set a field as a required field, but you mentioned that the "--" value is an option, and the system determines that the field is not empty when that value is filled in.
    You can create one real-time workflow to prevent creating records when the field value is '--'.
    In the workflow step, Stop Workflow(cancelled) action van achieve it.
     

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

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans