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.

How to create duplicate relatedlist in any form

Renu9
Tera Contributor

Hi All,

Can we duplicate the related lists on the same form.?

If yes, how to do it.

I am having feature and release tables , where in feature record, there is a reference field of release table with field name parent. So, it created a related list on release form.

In my requirement I need to duplicate it and add few conditions.

Thanks in Advance

1 ACCEPTED SOLUTION

Try this

(function refineQuery(current, parent) {

current.addQuery('u_deliverable', 'Main Deliverable');
current.addQuery('parent.number',current.number);
gs.addErrorMessage("feature is " +parent.getDisplayValue());
gs.addErrorMessage("release is " +parent.number);

})(current, parent);

Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

View solution in original post

6 REPLIES 6

Try this

(function refineQuery(current, parent) {

current.addQuery('u_deliverable', 'Main Deliverable');
current.addQuery('parent.number',parent.number);
gs.addErrorMessage("feature is " +parent.getDisplayValue());
gs.addErrorMessage("release is " +parent.number);

})(current, parent);

 

or 

(function refineQuery(current, parent) {

current.addQuery('u_deliverable', 'Main Deliverable');
current.addQuery('parent',parent.sys_id);
gs.addErrorMessage("feature is " +parent.getDisplayValue());
gs.addErrorMessage("release is " +parent.number);

})(current, parent);

Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Hi Renu,

 

Use the below line

current.addQuery('parent',parent.sys_id);

 

I hope rm_release table is referred in rm_feature table in 'parent' filed, If not replace the first parameter with the field name.