Notifications
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
​​​​​​​
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.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 796 Most Valuable Professional
Michael E. Gernaey 327 Super User 2025 Season 2
Power Platform 1919 268