We select any value from site table in incident form in that knowledge records need to be pop up in
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 06:11 AM - edited 09-25-2023 06:28 AM
Hi,
Site field is reference field it will reflect to site table.
once we select any of the value in site field we need to go that particular table. There we have Knowledge in related list. That particular knowledge records will be replicate to Incident related knowledge related list in incident form.
Can you anyone please help me or can you please provide me any code for this it is useful for me.
Thanks in Advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 10:54 PM - edited 09-25-2023 10:56 PM
Hi @mania ,
For your reference I have created Knowledge From Problem related list (Related Knowledge in your case) coming from problem related knowledge (reference table for Site field in your case). Knowledge and task relation you can find in m2m_kb_task table.
Please find attached screenshot for more information.
Refer below script to populate list on incident table. (use sys_relationship for script implementation, make required changes).
(function refineQuery(current, parent) {
// Add your code here, such as current.addQuery(field, value);
var attachedKBIDs = [];
var prb = parent.problem_id;
gs.addInfoMessage(prb);
var kbGr = new GlideRecord('m2m_kb_task');
kbGr.addQuery('task',prb);
kbGr.query();
if(kbGr.next())
{
attachedKBIDs.push(kbGr.getValue("kb_knowledge"));
}
current.addQuery('kb_knowledge.sys_id', 'IN', attachedKBIDs);
})(current, parent);
Please check and Mark Helpful and Correct if it really helps you.
Regards,
Mayur Shardul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 01:34 AM - edited 09-26-2023 01:43 AM
Hi @Mayur2109
We have two reference fields it will reflected to some other tables in that tables we have a contact related list so based on the Account and site selected, caller should only show the contacts under them
Can you please help me it will useful for me.
Thanks!
Mania