Creating Related List - Add button

Tadz
Kilo Sage
Kilo Sage

Hi Guys,

I was trying to create a Related List - Add button

I was checking the UI Action - Add button for Change

Upon checking the script:

var chngModal = new GlideModal('task_add_change_req');
	chngModal.setTitle(getMessage("Add Change Requests"));
	chngModal.setWidth(1200);
	chngModal.setAutoFullHeight(true);

 

I can't find "task_add_change_req" in the UI Page or UI Macro table.

I just want to check the script so that i can replicate and create my own custom one.

 

Can someone guide me where to find the script for it?

 

Thanks,

Tadz

1 ACCEPTED SOLUTION

Sebastian R_
Kilo Sage

Looks like it´s a hidden UI Page. I found the following script: https://your-instance.service-now.com/scripts/task_add_change_req.jsx which does the "Add selected".

They basically are using the "g_list.getChecked()" to get the checked item and doing an GlideAjax to add them to the table.

View solution in original post

5 REPLIES 5

Sebastian R_
Kilo Sage

Looks like it´s a hidden UI Page. I found the following script: https://your-instance.service-now.com/scripts/task_add_change_req.jsx which does the "Add selected".

They basically are using the "g_list.getChecked()" to get the checked item and doing an GlideAjax to add them to the table.

Thanks Sebastian! upon tracing i somehow made it work on Incident - Child Incident Related list.

Now I'm wondering if we can do the same for knowledge - related articles. 

Base on 

var url = new GlideURL("incident_add_records.do");

Not sure if there is a way to create a url for knowledge article though. 

Let me know if you have any idea on this 🙂

Could you please confirm me regarding this script means where we need to add this script for add selected button. Actually i'm doing like same for Related list Outages in Problem. But when I'm selecting outages and click on add selected button it'll not display in Related list.

Only that part is remaining. If you help me regarding this script that where we need to put it, it would be really helpful.

Joshwa Antony S
Mega Guru

Hello,

Its constructed within the UI action by glideModalTemplate

find_real_file.png

Regards,

JAS