Forum Post: RE: Getting OptionSet value and setting Label Name based on Value

Role Image

main reason is because the if condition checking the "C" text is inside the if condition checking the null, so it is never executed. This is your code a bit rewritten, you can start with this and debug if you have additional errors function onload(executionContext) { oppForm(executionContext); } function oppForm(executionContext) { var formContext = executionContext.getFormContext(); var optionSetChoice = formContext.getAttribute("dom_temperature").getText(); if (optionSetChoice == "C") { formContext.getControl("dom_temperature").setLabel("Celsius"); } }

Source link

Leave a reply

Please enter your comment!
Please enter your name here