Create Relationship for requested item table to relate change request

Abc 26
Tera Expert

Hello Experts,

 

i want to create a relationship for requested item table which displays the change request created from the requested item. Similarly i want to do it for change request which displays the RITM from which it has been created. Please help.

 

Applies to Table : sc_req_item
queries from: change_request

 

 

(function refineQuery(current, parent) {

	// Add your code here, such as current.addQuery(field, value);
   current.addQuery('u_sc_req_item', parent.sys_id);

})(current, parent);

 

@Ankur Bawiskar @Community Alums 

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@Abc 26 

so you are having field on CHG which refers to RITM table?

If yes then on RITM form you can directly add the related list

But now for CHG form you need to create defined relationship

Applies to table: CHG

Queries from: RITM

Script

(function refineQuery(current, parent) {

	// Add your code here, such as current.addQuery(field, value);
	current.addQuery('sys_id', parent.u_sc_req_item);

})(current, parent);

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@Abc 26 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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