Scroll down to bottom of page/to related list after pressing Save (Save & stay)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 07:27 AM
Hello guys!
I want to implement a function that takes me down to the bottom of the page of the record, when pressing the save button in the upper right corner. Either to the bottom or to the related list with the tasks.
How would I achieve that? It seems to be difficult with a client script. So I tried with a UI policy in the Global scope that looks like this (it's not working though):
I think I've missed the connection to the Save button?
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2025 04:12 AM
Hey @Ankur Bawiskar!
I see. I just wanted to let you know, this script works as long as you enable "Form button", but that's when a custom button is added. The UI Action script looks like this:
function scrollToTasks() {
setTimeout(function () {
var taskSection = document.querySelector("div[tab_caption='Aktiviteter']");
if (taskSection) {
taskSection.scrollIntoView({ behavior: "smooth", block: "start" });
}
}, 500);
}
So it works when I enable form button, but then this button is excessive:
Don't you think it should be possible to somehow connect the script to the Save button instead? And that the script executes after reloading the form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2025 04:41 AM
if the customer requires you can add this button and users can click and go to the related list directly
I will suggest not to touch the OOB functionality of save button
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