How to relate a custom Related Links table to its record?

alexg_
Giga Contributor

Hi,

I'm sorry for such an easy question, but my head seems to switch off after vacation..

What I have:

Env: Jakarta
1 Custom Table with Custom fields
This table has been added to the Relationships to Change Request
So I added this table to the CR as Related Link and all good, except:

The form is displayed on each CR and showing the complete set of data inside, so no relation to the current CR has been defined. 

What I need are 2 things:

1. Data stored within that table should have the direct relation to the Change Request 
2. Inside the CR it should be possible to view the data on that table, but only related to its parent Change Request.

I will attach the pic from what I want:

find_real_file.png

1 ACCEPTED SOLUTION

punith3
Kilo Expert

Hi alex,

Create a new reference field on the Fsb table called parent change  and the field should refer the change table, now in the relationship in the query with section add the code:

current.addQuery("parent_change", parent.sys_id);

or 

current.addQuery("parent_change", parent.number);

Now in the fsb table if you select a change in the parent_change field it will display in the associated change request under the Fsb related lists.

View solution in original post

7 REPLIES 7

Moy1
Kilo Guru

Since you have the custom table in the related list of the Change table, there must be some relationship between these two tables. You need to find out what that relationship is and then create a new filter by clicking on the hamburger on the top left hand corner of the related list.

punith3
Kilo Expert

You will need to identify the relationship between the 2 tables and then you can go to system definitions - relationship and create a new relationship between the 2 tables and add a query condition on how you want the tables to be related. Use this link for more details Defined related list.

alexg_
Giga Contributor

Thanks for the replies.

In Definitions -> Relationship I have created a new relationship between Change and my table. The query I added looks something like this:

(function refineQuery(current, parent) {
var query = current.addQuery("change", parent.getUniqueValue());
})(current, parent);

find_real_file.png

However its not really working.. I also added a reference field to Task and thought that I could define "Task=is dynamic" but there is no suchn an option in filters. 

With other words, I need to specify in my filter options for the Related List that the Task = current change number, and you are saying that this condition should be defined in Definitions -> Relationship (screened above)

find_real_file.png

 

 

Are you able to do anything by creating a new filter similar to the screenshot below?:

 

find_real_file.png