- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2015 10:02 AM
Hi ServiceNow Community Developers,
If I dynamically remove a choice option based on same value from another field is there a way to dynamically put that choice option back when the value on my other field changes to something else? For instance I have the following scenario, I have a field called equipment_to configure (reference to the alm_asset table) and I have another field called configuration type with 3 choices - hardware, software, provisioning. I have a catalog client script that runs onchange of equipment_to_configure. This catalog client script dynamically removes the 'provisioning' choice option from the configuration type if the equipment_to_configure is populated with an asset that has model category of 'Storage Device', this works as expected, no issues here. However the issue I am running into is that if I now change my mind and choose an equipment_to_configure that does not have model category of 'Storage Device' but that has something else, the choice list does not automatically refresh to put the 'provisioning' choice option back to the choice list and I don't know of a way to dynamically put back the value I had removed. I have to manually refresh the form to get all the choice values back.Would you please advise as to how I can overcome this behavior or is this how the removeOption API works by defualt.
Thanks,
Johannes
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2015 10:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2015 10:25 AM
Are you using addOption() to add values again if it changes back ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2015 10:52 AM
Hi Mani,
No I am not, is that what I should be using? The reason I did not try that was because I thought the addOption() is for adding a completely new value to the choice options i.e. a value that never existed before. I did not know that you can use it to put the old value back to the choice list however let me try it and see what happens.
Thanks,
Johannestty new cho
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2015 10:57 AM
Hi Mani,
Thanks for your help, addOption() seems to give the correct results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2023 09:10 AM
This is not working for me in Utah.
Any suggestions will be helpful.