- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 01:02 PM
We have a table where it has a field called "ID". We have a second table where there is a field called "Vulnerability" that contains the value of the ID field (it is not equal to the ID field of the first table). Is there a way to create a Related list on the first Table that shows all the records of the second table that contain the ID value in the Vulnerability field?
Thanks in advance!
Solved! Go to Solution.
- Labels:
-
Developer
-
related list condition
-
scripting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 02:04 PM
Hi @bpolo ,
you can add a encoded query something like below,
current.addEncodedQuery('sys_id!='+parent.getValue('sys_id')+'^descriptionLIKE'+parent.description)
or If you want to check contains then you can try something like below,
current.addQuery('descriptionLIKE' , parent.description);
These are just example please change it according to your requirement.
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 01:26 PM
Hi @bpolo ,
I have done something like this for change and release table,
You can create a Relationship
System definition -> Relationship
please refer below ,
Here current belongs to Queries from Table , so in change table there should be reference record which is capturing release record number (reference field)
Parent is release table record so we have to query something like below
current.addQuery('u_release_record.number', parent.number);
So Related list will be created for 'Applies to table' which is release.
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 01:59 PM
Hi Swathi
Thanks very much for your response! Do you know how we could code the query to check for contains a value instead of equal to a value. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 02:04 PM
Hi @bpolo ,
you can add a encoded query something like below,
current.addEncodedQuery('sys_id!='+parent.getValue('sys_id')+'^descriptionLIKE'+parent.description)
or If you want to check contains then you can try something like below,
current.addQuery('descriptionLIKE' , parent.description);
These are just example please change it according to your requirement.
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 02:15 PM
Thanks so much, Swathi!