Announcements
function removeOptionFromGlobalOptionSet(executionContext) { var formContext = executionContext.getFormContext(); var fieldName = "cr682_choose"; var optionToRemoveValue = "Test3"; var fieldControl = formContext.getControl(fieldName); var field = formContext.getAttribute(fieldName); if (field) { var options = field.getOptions(); var option = options.find(opt => opt.text === optionToRemoveValue); if (option) { fieldControl.removeOption(option.value); } } }
removeOption
removeOptionWebResource
.js
removeOptionFromGlobalOptionSet
function removeOptionFromGlobalOptionSet(executionContext) { var formContext = executionContext.getFormContext(); var fieldName = "cr682_choose"; var optionsToRemove = ["Test3", "Test4", "Test5"]; // Array of options to remove var fieldControl = formContext.getControl(fieldName); var field = formContext.getAttribute(fieldName); if (field) { var options = field.getOptions(); // Loop through each option to remove optionsToRemove.forEach(function(optionToRemoveValue) { var option = options.find(opt => opt.text === optionToRemoveValue); if (option) { fieldControl.removeOption(option.value); } }); } }
​​​​​​​- Sathyamoorthy Vijayakumar | LinkedIn
​​​​​​​
setValue
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.
Congratulations to our 2026 Super Users!
Congratulations to our 2025 community superstars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Vish WR 993
Valantis 675
11manish 545