- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2025 12:40 AM
HI All,
i write a code on variable set, it's working catalog form but when i use this form under orderguide should not work on orderguide
Means this code should not work on this sc_cat_item_guide table
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2025 01:08 AM
see by checking in URL in client script.
if you find something specific to order guide then don't run
Something like this
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var url = top.location.href;
if (url.indexOf('sc_cat_item_guide') != -1) {
if (newValue.length < 50) {
g_form.showErrorBox("business_justification", "You must enter at least 50 characters", true);
// Wait 30 seconds (60000 milliseconds) before resetting to old value
setTimeout(function() {
g_form.setValue("business_justification", oldValue);
}, 3000);
} else {
g_form.hideErrorBox("business_justification");
}
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2025 01:08 AM
see by checking in URL in client script.
if you find something specific to order guide then don't run
Something like this
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var url = top.location.href;
if (url.indexOf('sc_cat_item_guide') != -1) {
if (newValue.length < 50) {
g_form.showErrorBox("business_justification", "You must enter at least 50 characters", true);
// Wait 30 seconds (60000 milliseconds) before resetting to old value
setTimeout(function() {
g_form.setValue("business_justification", oldValue);
}, 3000);
} else {
g_form.hideErrorBox("business_justification");
}
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2025 01:15 AM
i write a code on variable set, it's working catalog form but when i use this form under orderguide should not work on orderguide
Means this code should not work on this sc_cat_item_guide table , run only sc_cat_item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2025 01:32 AM
Hi @basha shaik
you can wrap your logic in a check that verifies the current table. Try adding this condition at the top of your script:
the script will exit without running any validation logic. Everything else in your code looks good—just plug this check in right after the if (isLoading || newValue === '') line and it should work as expected!
If this helps kindly accept the solution thanks much.
Kind Regards,
Mohamed Azarudeen Z
Developer @ KPMG
Microsoft MVP (AI Services), India