When sub-account is selected, we wanted to see the related articles and contacts of parent account.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 03:56 AM
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.
Thanks in Advance!
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 04:36 AM
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.