When sub-account is selected, we wanted to see the related articles and contacts of parent account.

mania
Tera Contributor

Hi,

Have a requirement that whenever a sub-account or child account is selected on the incident form, we should show all the related KB articles corresponding to that child account and parent account. 

 

Have attached the screenshots for your understanding. Kindly help me with the script for the same.

mania_0-1695898481577.png

mania_0-1695898585563.png

 

Thanks in Advance!

 

 

1 REPLY 1

Peter Bodelier
Giga Sage

Hi @mania 

If you navigate to ‘System Definition -> Relationships’ and create a new relationship record, use the following script:

 

(function refineQuery(current, parent) {

current.addQuery('<<your company field name on kb_knowledge>>', parent.company.sys_id).addOrCondition('<<your company field name on kb_knowledge>>', parent.company.parent.sys_id);

})(current, parent);

 

Applies to table incident

Queries from table Knowledge Article


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.