- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2017 03:55 AM
The exi cluster field is drop down with none .
and its a mandatory field
if no value is given its still allowing to save the ritm form
is there any value for none
I dont want to give a default value to this field
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2017 05:09 AM
Hi Bhagyashree,
So it means somebody has added None as choice and not used drop down with none functionality at dictionary level. Can you configure the dictionary for that field and check choices for that
If somebody has added --None-- as choice then 2 options
1) remove --None-- as choice and make it dropdown with none
2) update your script to compare with --None-- whenever you want to compare with emptiness
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2017 03:58 AM
Hi Bhagyashree,
If it is drop down with none and is mandatory field then you need to select value other than None.
For None the value is '' i.e. empty string
Can you check the dictionary again for this field?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2017 04:11 AM
.
I gave the condition if exi_cluster is empty string then give alert("fill exi cluster").
Not working
--None--exi
when none is selected i have given an alert its showing the above line
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2017 04:33 AM
Hi Bhagyashreee,
So when you have used below line and if getting alert when empty then your code is working fine right? It is showing alert to fill it if it is empty
if(g_form.getValue('exi_cluster') == ''){
alert('fill exi cluster');
}
Can you share your script?
What is the exact confusion you are having?
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2017 05:07 AM
var exsi_cluster = g_form.getValue('exsi_cluster');
if(exsi_cluster == '')
{
alert("fill exi");
}
no alert is coming for both cases(none or having some value)
i tried to give alert before if
var exsi_cluster = g_form.getValue('exsi_cluster');
alert(exsi_cluster );
if(exsi_cluster == '')
{
alert("fill exi");
}
so in above code if none option is present i am getting an alert like
if some value is present in exi cluster its giving proper value
My issue is that in above 1st code why it is not going inside the if loop if none option is present