Accessing records in a related list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2017 02:55 AM
Is there any way for me to access the records in a specific related list in a script?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2017 02:57 AM
Yes, you can gliderecord it in a client script or a business rule when ever you want to updte the related list.
But, can you provide more details on your requirement?
Thanks,
Vinitha.K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2017 03:23 AM
I have table A that has a field that references table B. In this table there is a related list (Rel) with records from table C. I need to access the records in Rel in a script that runs in table A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2017 03:03 AM
You can write business rule and compare parent to with your current sys id and fetch the related list record.
objname.addQuery('parent', current.sys_id);
Please provide more information, if you looking for any specific requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2017 04:25 AM
This is the code that i have created but still not working as intended
function ChangeRequestChoice() {
var rel = new GlideRecord('u_m2m_customer_ser_service_agre');
rel.addQuery('u_service_agreement',current.u_service_agreement.toString());
rel.query();
var aux = [];
while(rel.next()){
gs.log('customer sys_id: ' + rel.u_customer_services.toString(),'Oprah');
aux.push(rel.u_customer_services.toString());
}
return (aux.indexOf(current.getUniqueValue()) != -1);
}