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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Regarding Option Set

(0) ShareShare
ReportReport
Posted on by 104

I want to add the dynamic Single Line Text Field data to Option Set I have written JavaScript regarding the same, But I want maximum value of available options set options see the example for your reference

 Example:

Skill is option set [Java, C++, C] there options are available and there values are as follow [112550000,112550001, 112550002]

if I will add next skill using JavaScript I want  maximum value which is present at option set for.Ex -> 112550002

Is there any method which will fetch the maximum value of option set automatically

Thanks! 

I have the same question (0)
  • Suggested answer
    meelamri Profile Picture
    13,218 User Group Leader on at

    Hello,

    I don't know if I understand your need. This is my scenario. I have an option and [B1, B2, B3, B4, B5, B6 with the values [1, 2, 3, 4, 5, 6.

    To get the maximum value, I implemented the following code:

    function getOptionSetMaxValue(executionContext){
        var formContext = executionContext.getFormContext();
        var optionSetBAllOptions = formContext.getAttribute('uma_optionb').getOptions();
        var maxValueInOptionSetB = Math.max(...optionSetBAllOptions.map(o => o.value), 0);
        console.log("MAxValue: "  maxValueInOptionSetB);
    }

    pastedimage1614595030778v1.png

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 April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

#2
ManoVerse Profile Picture

ManoVerse 60 Super User 2026 Season 1

#3
11manish Profile Picture

11manish 43

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans