
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!
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);
}