- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 01:05 AM
Happy Christmas ServiceNow Community 🙂
Can anyone point out where I am going wrong with this catalog client script:-
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 02:29 AM - edited 12-28-2023 02:31 AM
Hi @jonathangilbert, I have got it working with slight modification as highlighted below.
Regards,
Sunil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 02:51 AM - edited 12-28-2023 02:51 AM
It's because of these lines in your script. That means if new value is empty, it will return with no action.
if (isLoading || newValue === '') {
return;
}
So you can remove the newValue condition.
if (isLoading) {
return;
}
Or you can separate it to a new block to do something when the field comes to empty. (Ex: Clear value of some fields)
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 03:42 AM
Hi @jonathangilbert ,
i will suggest first you to add logs (g_form.addInfoMessage('test'))on the loops make sure those logs entering into the loops based the values that you have given . Once those logs working fine then just use your logic for calculation if you are able to do calculation then combine with your if conditions.
May be in this way you will get clear idea how it is working.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar