Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Need help on UI Action

Khalid9030
Tera Contributor

Hello,

 

We need to create an update button on the Incident form that overrides the out-of-the-box (OOB) update button. When we submit the update button, it should update the form. Before updating the form, a pop-up message should be displayed. Once the user clicks on the pop-up message, the form should redirect to the list view. How can we achieve this? and this button should be displayed specific form view. 

1 ACCEPTED SOLUTION

Shruti
Mega Sage
Mega Sage

 

function click() {
    var answer = confirm("Please confirm you want to update the record");
    if (answer == true) {
        var URL = '/incident_list.do';

        window.open(URL);
        gsftSubmit(null, g_form.getFormElement(), '<ui action name>'); //replace new ui action name
    } else {
        return false;
    }
}

if (typeof window == 'undefined')
    updateRecord();

function updateRecord() {
    current.update();  
}

Shruti_0-1736492874067.png

Check the client checkbox and onclick field on UI action . To display the button in specific view update the ui action visibilty related list

Shruti_1-1736492958629.png

 

 

View solution in original post

2 REPLIES 2

Shruti
Mega Sage
Mega Sage

 

function click() {
    var answer = confirm("Please confirm you want to update the record");
    if (answer == true) {
        var URL = '/incident_list.do';

        window.open(URL);
        gsftSubmit(null, g_form.getFormElement(), '<ui action name>'); //replace new ui action name
    } else {
        return false;
    }
}

if (typeof window == 'undefined')
    updateRecord();

function updateRecord() {
    current.update();  
}

Shruti_0-1736492874067.png

Check the client checkbox and onclick field on UI action . To display the button in specific view update the ui action visibilty related list

Shruti_1-1736492958629.png

 

 

Rohit99
Mega Sage

Hi @Khalid9030,

 

1. Need to insert and stay for Update button (on table 'Global')

Rohit99_0-1736492871210.png

 

2. Do the Configuration as mentioned in following screenshot.

Rohit99_1-1736493199786.png

 

3. For View, you have related list below UI action.

Rohit99_2-1736493316276.png

 

 

Please mark my response as correct and helpful if it helped solved your question.

 

Thanks,

Rohit Suryawanshi