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.

why related list is not shwoing?

shabbir5
Tera Guru

Hi All,

 

I have created a Related list by using "relationships"

 

and this i given applies to table as"project"

 

but when i open the project table records then these new related list is not showing

 

what is the reasonn for it ?

 

Regards,

Shabbir Shaik

18 REPLIES 18

@shabbir5 

is that the complete script? looks incomplete

share complete one

I believe the script below I am sharing should bring the related CIs associated to the Project Resource Plan users

(function refineQuery(current, parent) {

    var assignedToArr = [];
    // Add your code here, such as current.addQuery(field, value);
    var gr = new GlideRecord('resource_plan');
    gr.addQuery('top_task', parent.sys_id);
    gr.addQuery('state=3');
    gr.query();
    while (gr.next()) {
        assignedToArr.push(gr.user_resource.toString());
    }

    current.addQuery('assigned_to', 'IN', assignedToArr.toString());

})(current, parent);

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

if query is wrong , then the related list don't display ?

@shabbir5 

related list should display but if query is wrong then data won't display

share screenshot on whether you added the Related list on correct form view

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

PrashantLearnIT
Tera Sage

Hi @shabbir5 

 

Right click on the Project Form on Header, context menu will then click on Configure>>List Layouts and add your newly created relationship. Screenshot is added for reference:

PrashantLearnIT_0-1765383738468.png

 

********************************************************************************************************
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.

********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect


Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************

no i tried its not working