UI action in related list view

simransagar
Tera Contributor

Can anyone help me with the UI action script, when click on Refresh button, attestation status should update from in progress to completed. This is a related list.

simransagar_1-1757411048490.png

 

4 REPLIES 4

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @simransagar 

If a user updates the state on a record, then you can open the related item and load it like this—the latest changes will appear.

 

DrAtulGLNG_0-1757432770997.png

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Ankur Bawiskar
Tera Patron
Tera Patron

@simransagar 

so it's list banner button and you are selecting a record and it's state should be updated.

update your List Banner UI action script as this

1) Make your List Banner UI action as client side with Client Checkbox - true

2) Onclick - updateRecords()

3) Script

function updateRecords(){

 var selectedRecords = g_list.getChecked();
    // use GlideAjax and pass these sysIds and then use GlideRecord to update the State
    var ga = new GlideAjax('ScriptInclude');
    ga.addParam('sysparm_name', 'updateRecords'); // fixed param name
    ga.addParam('sysparm_sysids', selectedRecords);
    ga.getXML(handleResponse);

    function handleResponse(response) {
        location.reload(true);
    }

}

AnkurBawiskar_0-1757433381286.png

 

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

@simransagar 

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.

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

Hey, 

Thanks for the solution.

Can you please help me with the exact syntax (how to call Script include in UI action).

also, I don't want to select any record it should update for all thee 3 record shown in image.(I have used sysverb in action name).