Custom related list query from assigned incident

Community Alums
Not applicable

Hello,

I have a requirement that adding new related list that query the assigned incident and category is hardware from the problem form and should show that problem number on the related list of the incident that assigned earlier on the problem form.

P.S: i tried to add the relationship but only the category is hardware but should be show only the problems are related to incident.

1 REPLY 1

Brad Bowman
Kilo Patron
Kilo Patron

Since you should only have one Problem record associated with an Incident, add a line to whatever you already have in your custom relationship Query with:

(function refineQuery(current, parent) {
	current.addQuery('sys_id', parent.problem_id);
})(current, parent);

 So this is basically showing the details of the Problem related record - much the same as clicking the reference icon.