Show all RITMs for a Request using a UI Action

rah dev
Tera Contributor

Hi everyone,

I need help or guidance with a small requirement.

As you know, when we submit a request in the Service Catalog, one or more RITMs (Requested Items) are generated under that request. I want to add a UI Action (button) on the Request (sc_request) form that, when clicked, should display all RITMs associated with that request.

 

I am open to any approach like ui page and script include — whether it opens a list view, a UI page, or anything else — as long as the end-user can see all RITMs related to that request record with a single click.

rahdev_0-1746631384861.png

Thanks in Advance!

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@rah dev 

you can use UI action and show the list of RITM in UI page

GlideDialogWindow: Popup Record List 

UI Action: on sc_request table

Client - True

Onclick - showRITM()

Script:

function showRITM() {
    var w = new GlideDialogWindow('show_list');
    w.setTitle('Associated RITMs');
    w.setPreference('table', 'sc_req_item_list');
    w.setPreference('sysparm_view', 'default');
    //Set the query for the list
    var num = g_form.getUniqueValue();
    var query = 'request=' + num;
    w.setPreference('sysparm_query', query);
    //Open the popup
    w.render();
}

AnkurBawiskar_0-1746634035620.png

 

Output:

AnkurBawiskar_1-1746634173229.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

View solution in original post

8 REPLIES 8

Chaitanya ILCR
Kilo Patron

Hi @rah dev ,

Just configure related lists and add requested item 

 

ChaitanyaILCR_0-1746632532971.pngChaitanyaILCR_1-1746632613686.png

ChaitanyaILCR_2-1746632618554.png

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

rah dev
Tera Contributor

Hi @Chaitanya ILCR, thanks for your response but we need to solve it via ui action, ui page etc!

Ankur Bawiskar
Tera Patron
Tera Patron

@rah dev 

you can use UI action and show the list of RITM in UI page

GlideDialogWindow: Popup Record List 

UI Action: on sc_request table

Client - True

Onclick - showRITM()

Script:

function showRITM() {
    var w = new GlideDialogWindow('show_list');
    w.setTitle('Associated RITMs');
    w.setPreference('table', 'sc_req_item_list');
    w.setPreference('sysparm_view', 'default');
    //Set the query for the list
    var num = g_form.getUniqueValue();
    var query = 'request=' + num;
    w.setPreference('sysparm_query', query);
    //Open the popup
    w.render();
}

AnkurBawiskar_0-1746634035620.png

 

Output:

AnkurBawiskar_1-1746634173229.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

@rah dev 

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