clearoptions() and removeoptions() not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2016 09:29 AM
Hi All,
Based on the conditions, i need to add/remove options from the choice data type fields. I have written 2 scripts. one script is working as expected but in second script it is not clearing the options eventhough it is going into the loop( i have checked by using alert). And i have checked all the field names and choice values.
What could be the possible reason for this behaviour and how to fix this issue?
Thanks and regards,
Swamy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2016 06:27 AM
Hi Swamy,
I just wanted to confirm oen thing that the field u_xyz is drop down value as clearoptions work for drop down values.
I am assuming that it is drop down only.
Please suggest.
Regards,
Shamma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2016 06:38 AM
Hi Swamy,
Please find the details below:
clearOptions(fieldName)
Removes all options from a choice list.
clearValue(fieldName)
Removes any value(s) from the specified field.
Please make sure that you are uisng clearoption for option field and clear value for others.
GlideForm (g form) - ServiceNow Wiki
Hope that helps you!
Regards,
Shamma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2016 08:33 AM
Hi Shamma Salhotra, Rohit Sarkar,Manoj Kumar ,
Thanks to you for your time.
Actually, the fields are adde twice on the form ( in 2 sections) and i have noticed it, after removing the fields from 1 section then everything looks fine.
Regards,
Swamy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2016 07:00 AM
clearOptions() wont work if it is not a choice field. And "else" part is working ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2016 08:36 AM
Yes I noticed that but i thought thats your requirement.
