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

Notifications

Announcements

No record found.

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,216 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Pallavi Phade Profile Picture

Pallavi Phade 96

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 69 Super User 2025 Season 2

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 43 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans