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

@Rajanmehta 

unless REQ has interaction record stored you cannot get the contact type from Interaction and store in REQ

Regards
Ankur

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

@Rajanmehta 

Hope you are doing good.

Let me know if I have answered your question.

If so, please mark appropriate answer as correct & helpful to close the thread.

If not, please let us know if you need some more assistance.

Regards
Ankur

 

 

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

Ankur Bawiskar
Tera Patron
Tera Patron

@Rajanmehta 

Hope you are doing good.

Let me know if I have answered your question.

If so, please mark appropriate answer as correct & helpful to close the thread.

If not, please let us know if you need some more assistance.

Regards
Ankur

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