Related list for multiple pos

Poorva Bhawsar
Mega Sage

Hi Community,

 

I want to create a custom related list where i have 2 tables involved. One table has the user id and po number in it and another table has the po id which is a reference to po number of first table.

 

I want to show the records of multiple po ids per user in the main table. Main table contains all these fields in it.

 

What is the logic to show multiple po ids per user?

 

Thanks

9 REPLIES 9

Poorva Bhawsar
Mega Sage

Here is the logic i have written.

 

(function(parent) {
                    var relatedRecords = new GlideRecord('x_roho_ewm_infor_0_informatics_ewm');
                    relatedRecords.addQuery('active', true);
                    relatedRecords.addQuery('po_number_integration_with_procurement', parent.getUniqueValue());
                    relatedRecords.query();
                    return relatedRecords;
                })(current);
 
PO No is nothing but the PO ids from another table. I just want to show data of that table.

Runjay Patel
Giga Sage

Hi @Poorva Bhawsar ,

 

If PO number and User id are properly referenced then why you are creating custom related list. ServiceNow will create related list by default you just need to bring those in related list section.

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

But i want to have a related list of po id table not this table.

@Runjay Patel i want related list of the 2nd table where when user id field from first table have multiple po ids from 2nd table i want to show that in my related list.