Related list copy

sip
Tera Contributor

Hello all ,

I have two tables Demand and Project where the Demand table is the parent table and the project is the child table of demand .

In the demand table ,there are two related list which are Stakeholders and Decision tabs .

Now the requirement is that I want the same two related list on my project table as it is in demand and Carry over any information from theses tabs into the Project when created.

Can anyone help me with how to proceed with this .

Any suggestions would be welcome 🙂 

1 ACCEPTED SOLUTION

There isn't any. Its just the columns that are being displayed in list view.

 

The Stakeholder for Demand has additional () part which I guess is the portfolio value while the one in Project has normal User name displayed.

You can check for the list layout once & then get it compared once for better understanding.

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

View solution in original post

22 REPLIES 22

Seems there is no demand field available on the form.

 

You can try using below

var dm=new GlideRecord('dmn_demand');
	dm.addQuery('project',parent.sys_id);
	dm.query();
	while(dm.next())
		{
			var sid=dm.sys_id;
		}
	current.addQuery('demand',sid);

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

sip
Tera Contributor

Hello Jaspal ,

Thanks for your overwhelming response ,it really worked out for stakeholders related list .

Now I want to have the same condition for decision tab like I want to move the values from decision tab from demand to project .

I tried doing the similar way but am unable to .

Can you provide a fix for this also ?

Thanks in advance.

Try using & referring below snippet & screenshot.

(function refineQuery(current, parent) {

	// Add your code here, such as current.addQuery(field, value);
var d=new GlideRecord('dmn_demand');
	d.addQuery('project',parent.sys_id);
	d.query();
	while(d.next())
		{
			var dmnid=d.sys_id;
		}
	current.addQuery('demand',dmnid);
	
})(current, parent);

find_real_file.png

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

sip
Tera Contributor

Thanks .

And do I npt need to create Business rule for this ?

But one concern is there is already decision tab present in project form in related list still shall I create a new relationship?

No Business rule required.

 

Yes, since the one available is only for Project--> Decisions we can replace it with the one you have created.

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.