Scroll down to bottom of page/to related list after pressing Save (Save & stay)

ronro2
Tera Contributor

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. 

ronro2_1-1742567207643.png

 

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): 

ronro2_0-1742567043036.png


I think I've missed the connection to the Save button? 

Thanks in advance!

6 REPLIES 6

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: 

ronro2_0-1742641742160.png


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? 

 



@ronro2 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader