Relationship & sys_attachment: Question?

Community Alums
Not applicable

Hey Everyone, 

 

Is there any way to query the table for the table sys id on the sys_attachment table? 

Screenshot 2023-06-28 130530.png

Basically I want to get the table_sys_id in my relationship query. 

 

Below is my code. 

(function refineQuery(current, parent) {

    // Add your code here, such as current.addQuery(field, value);
    current.addQuery('table_name', 'x_g_cfd_elims_cases');
    current.addQuery('table_sys_id', 'table_sys_id');


})(current, parent);

but it isn't working, what am I missing? I just want to get the attachments from the elims cases with the table sys id to display on the incident table. The elims case created an incident and appears as a related record on the elims case. 

 

Help anyone? 

 

 

2 REPLIES 2

Manmohan K
Tera Sage

Hi @Community Alums 

 

Check with below script 

(function refineQuery(current, parent) {

    // Add your code here, such as current.addQuery(field, value);
    current.addQuery('table_name', 'x_g_cfd_elims_cases');
    current.addQuery('table_sys_id', parent.sys_id);


})(current, parent);

Community Alums
Not applicable

That doesn't work for me. Not sure why it doesn't.