How do I get related list record through script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2020 08:11 AM
Hello,
I am trying to get related list REQ record from Interaction table via script. Can someone please advise how do I get that?
I tried below code but doesn't work.
var x = new GlideRecord('interaction');
x.addQuery('number','IMS0000623');
x.query();
gs.print(x.getRowCount());
if(x.next()){
var y = x.getValue('task');
gs.print(y);
}
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2020 08:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2020 08:19 AM
Hi Rajan,
So in your REQ table record is interaction value populated?
if it is populated then only it will be shown in the related list
Please add some interaction value in that parent_interaction field on REQ for REQ0338030 and then check
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2020 09:22 AM
Hi Ankur,
I am not seeing any values on REQ table. I see it only on Interaction related list tab as I showed in my earlier snap shot.
I believe we might have to create a view to combine both table. Your thoughts !!
Thanks,
Rajan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2020 10:14 AM
Hi Rajan,
please try populating the IMS interaction record into the parent interaction field of REQ and save it
Once saved the IMS record would be shown in the related list of Interaction on the REQ form
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2020 02:21 PM
Hi Ankur,
The whole idea is to get the contact type from Interaction and transfer it to corresponding Request. We have some historical data which need some rework on Contact type.