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

The RITM has a variable editor that includes a reference-type variable. I want when I click a button, instead of showing the RITM details in the popup, it should show the details of that reference variable.

Hi @Ankur Bawiskar, if In a variable editor for an RITM that contains a reference-type variable, how can we make it so that when I click a button, the popup shows the details of the referenced variable instead of the RITM?

@DevYadav 

can you please post a new question for this and tag me there?

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

what if I want to have a UI Macro on RITM form similar to one we have on the Incident form, how to achieve that?