Comments on: Removing or Disabling Choice List Options https://servicenowguru.com/client-scripts-scripting/removing-disabling-choice-list-options/ ServiceNow Consulting Scripting Administration Development Wed, 06 Mar 2024 21:00:36 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Steven https://servicenowguru.com/client-scripts-scripting/removing-disabling-choice-list-options/#comment-6594 Tue, 06 Nov 2018 13:44:26 +0000 https://servicenowguru.wpengine.com/?p=950#comment-6594 Mark

This doesn’t work in the Service Portal. Do you have a solution for this on the Service Portal or something we can add to the UI Script to handle the Service Portal?

]]>
By: Avinash https://servicenowguru.com/client-scripts-scripting/removing-disabling-choice-list-options/#comment-6592 Wed, 20 Sep 2017 08:21:09 +0000 https://servicenowguru.wpengine.com/?p=950#comment-6592 This code does not work in service portal. Is there any workaround to do the same in portal.

]]>
By: Mila Morales https://servicenowguru.com/client-scripts-scripting/removing-disabling-choice-list-options/#comment-6591 Thu, 07 Sep 2017 12:36:48 +0000 https://servicenowguru.wpengine.com/?p=950#comment-6591 In reply to Clint Masters.

User may use Reference Qualifier which can limit the list of groups or list of record on reference field. Also user may use javascript or script include to do the logic.

User may use this link for reference.
http://wiki.servicenow.com/index.php?title=Reference_Qualifiers#JavaScript_Example:_Limiting_the_Assigned_to_Field_by_Users_with_a_Specified_Role

]]>
By: Clint Masters https://servicenowguru.com/client-scripts-scripting/removing-disabling-choice-list-options/#comment-6590 Fri, 11 Aug 2017 00:15:29 +0000 https://servicenowguru.wpengine.com/?p=950#comment-6590 Is there any way to hide an option from a reference field. For example I have a field that looks up groups but in certain scenarios I do not want the user to be able to select some of them. Is there any way that you know of to accomplish this using removeOption or something similar?

]]>
By: Vinoth https://servicenowguru.com/client-scripts-scripting/removing-disabling-choice-list-options/#comment-6589 Wed, 25 Jan 2017 12:17:25 +0000 https://servicenowguru.wpengine.com/?p=950#comment-6589 I want to make the reject action as readonly on choice list UI action. Can any one guide me how to implement this?

]]>
By: sravani https://servicenowguru.com/client-scripts-scripting/removing-disabling-choice-list-options/#comment-6588 Fri, 20 Jan 2017 11:20:58 +0000 https://servicenowguru.wpengine.com/?p=950#comment-6588 It works perfectly!

]]>
By: Jeremie Landers https://servicenowguru.com/client-scripts-scripting/removing-disabling-choice-list-options/#comment-6587 Thu, 29 Oct 2015 22:11:45 +0000 https://servicenowguru.wpengine.com/?p=950#comment-6587 In reply to Mark Stanger.

If I read this correctly in the SNow wiki release notes sections, both g_form.enableOption and g_form.disableOption were enabled in Fall 2010 Stable 3, but they were both removed as of the June 2011 Preview 1. If this is correct Mark, your functions are still the only way to perform these tasks.

]]>
By: Mark Stanger https://servicenowguru.com/client-scripts-scripting/removing-disabling-choice-list-options/#comment-6586 Tue, 26 May 2015 14:18:15 +0000 https://servicenowguru.wpengine.com/?p=950#comment-6586 In reply to Prasanna Kumar Duvvuri.

You’ll have to contact ServiceNow support about this one then. I don’t know why that wouldn’t be working but it’s specific to their API or a unique configuration in your instance.

]]>
By: Prasanna Kumar Duvvuri https://servicenowguru.com/client-scripts-scripting/removing-disabling-choice-list-options/#comment-6585 Tue, 26 May 2015 14:11:29 +0000 https://servicenowguru.wpengine.com/?p=950#comment-6585 Hey Mark,

I already used the g_form before that disableOption. But, I’m getting error like below:

onChange script error: TypeError: g_form.disableOption is not a function function onChange_kb_knowledge_topic_2(control, oldValue, newValue, isLoading, isTemplate) { if (isLoading) { return; } var topicField = g_form.getValue(‘topic’); alert(topicField); alert(g_scratchpad.isNewsDL1); alert(g_scratchpad.isNewsDL2); if((topicField == ‘News’) && g_scratchpad.isNewsDL1 == true && g_scratchpad.isNewsDL2 == false){ g_form.disableOption(‘category’,’Help Desk Portal Alert’); } if((topicField == ‘News’) && g_scratchpad.isNewsDL1 == false && g_scratchpad.isNewsDL2 == true){ g_form.disableOption(‘category’,’Scrolling News’); } }

Please let me know how to fix this issue.
Thanks & Regards!
Prasanna Kumar Duvvuri

]]>
By: Mark Stanger https://servicenowguru.com/client-scripts-scripting/removing-disabling-choice-list-options/#comment-6584 Tue, 26 May 2015 14:01:59 +0000 https://servicenowguru.wpengine.com/?p=950#comment-6584 In reply to Prsaanna Kumar Duvvuri.

As noted above, you should use the standard ‘g_form.enableOption’ and ‘g_form.disableOption’ included in ServiceNow. There’s no further need for a UI script.

]]>