Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

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

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

In this video i have explained about Web service integration in ServiceNow like how it works, how we can configure it, what are the prerequisite and many more. I have covered below topics in this video. 1. understand Web Service. Like when and how we will use it. 2. Talked about Inbound and ...

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.