The CreatorCon Call for Content is officially open! Get started here.

How do I get related list record through script?

Rajanmehta
Mega Guru

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.

find_real_file.png

 

12 REPLIES 12

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Do you have a field on User Task which stores Interaction record info?

Regards
Ankur

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

hi Ankur,

No I don't see Interaction record field on User' Task table.

Thanks,

Hi,

So how the relationship exists between those 2 tables

There must be some common field if this is defined relationship

Regards
Ankur

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

@Rajanmehta 

Any update on this thread?

Regards
Ankur

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