- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2025 12:45 AM
Hello, i want to modify the functionality of background script i want to modify the run script button but i don't know where to find that
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2025 03:55 AM
Hi @gauravagarw ,
I don't think the button is available for configuration
I have tried something
you can create a global UI script with something below
and select the element and add events to the elements something like click in this scenario
script I used
window.addEventListener('load', function() {
if (window.location.href.includes('sys.scripts.modern.do')) {
$('MANDATORY').style.backgroundColor = 'red';
$('MANDATORY').addEventListener('click',()=>g_form.addErrorMessage('hello'))
}
});
result
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2025 03:16 AM
if you are thinking to change the color etc then not possible as it comes from platform level.
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
04-10-2025 03:22 AM
no i don't want to change the color i want to perform some action before the actual scripts run in background
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2025 04:45 AM
not possible, whatever you want to perform will be written as script
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
04-10-2025 03:55 AM
Hi @gauravagarw ,
I don't think the button is available for configuration
I have tried something
you can create a global UI script with something below
and select the element and add events to the elements something like click in this scenario
script I used
window.addEventListener('load', function() {
if (window.location.href.includes('sys.scripts.modern.do')) {
$('MANDATORY').style.backgroundColor = 'red';
$('MANDATORY').addEventListener('click',()=>g_form.addErrorMessage('hello'))
}
});
result
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya