Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Option with Dropdown --None--

_bhishek
Tera Guru

I have created one on change client script.' Time taken'(on change field) is selected as 1 hour then business application option should be removed and in other options 1 hour should be visible .

When i am selecting  time taken as 1 hour then business application not visible (as expected).But after this i am selecting --None --- the 1 hour is still not visible.

Please confirm how can i so all option would be visible  if --None--  slected.Providing the script ,which i am using.Please suggest.

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }
    if (newValue == '1Hour') {
        g_form.removeOption('u_classification, 'Business Application', "Business Application");
    } else if (newValue == '') {
        g_form.addOption('u_classification', 'Business Application', "Business Application");
    } else {
        g_form.addOption('u_classification', 'Business Application', "Business Application");
    }
    //Type appropriate comment here, and begin script below

}
5 REPLIES 5

@_bhishek 

Hope you are doing good.

Did my reply answer your question?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader