- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2025 03:36 AM
Hi Team
I need assistance with developing a new UI action for the related list. Specifically, I would like to implement functionality where, upon clicking on the related list button , five change tasks Should be generated . Could someone please provide a code examples for creating the change tasks? Additionally, this UI action should only be visible when the short description of the change request is set to "Server Patching"
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2025 03:44 AM
it should be list banner button with script like this, please enhance as per your requirement
for (var i = 1; i <= 5; i++) {
var task = new GlideRecord('change_task');
task.initialize();
task.change_request = current.sys_id; // Link to parent Change Request
task.short_description = "Task " + i + " for Server Patching";
// Set other fields as needed
task.insert();
}
action.setRedirectURL(current); // Refresh the form
UI action will look like this, please enhance if required
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
05-06-2025 03:44 AM
it should be list banner button with script like this, please enhance as per your requirement
for (var i = 1; i <= 5; i++) {
var task = new GlideRecord('change_task');
task.initialize();
task.change_request = current.sys_id; // Link to parent Change Request
task.short_description = "Task " + i + " for Server Patching";
// Set other fields as needed
task.insert();
}
action.setRedirectURL(current); // Refresh the form
UI action will look like this, please enhance if required
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
05-06-2025 08:57 PM
Hope you are doing good.
Did my reply answer your question?
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