Incident - Knowledge relationship

Dilip15
Kilo Contributor

Hi, 

I would like to show the incident record under one of the related list on the knowledge form on which i have selected one KB article from the related search results document and marked as this helped. 

For example in the below image 1) I am choosing one KB Article from the "Related Search Results" tab and select "preview" and marked that as "This Helped".

find_real_file.png

 

find_real_file.png

 

 

2)After the saving the Incident form I want that incident which has been marked only as "This Helped" to be displayed under the knowledge form in one of the custom relationship i created. I tried myself by creating custom relationship and applied to "Knowledge" Table and queried from "cxs_relevant_doc_task" relevant knowledge task table to achieve this. This is how it looked:

find_real_file.png

3) This brought me all the incidents tagged as "This Helped" under that related list on the knowledge form. Refer the image below:

find_real_file.png

4. As mentioned in the beginning I want only those specific Incident records under 1 knowledge article on which it has been marked as "This Helped" should be displayed under the related list. I don't know how to query further to achieve this.

Looking for help!

1 ACCEPTED SOLUTION

Mark Stanger
Giga Sage

You're close, but I think your 'Relationship' record in step 2 is probably querying from the wrong table.  This should get you what you need.

1)  Change your 'Queries from table' value to query from the 'Relevant document detail [cxs_rel_doc_detail]' table.

2)  Use this for your 'Query with' script

(function refineQuery(current, parent) {

	// Query for relevant docs
	current.addQuery('relevance', 'This helped');
	current.addQuery('relevant_doc', parent.sys_id);
	current.addNotNullQuery('relevant_doc');

})(current, parent);

3)  Configure your related list layout to include the 'Relevant Document.Relevant To' field and remove anything else you don't need.  You should end up with something that looks like this.

find_real_file.png

View solution in original post

3 REPLIES 3

Mark Stanger
Giga Sage

You're close, but I think your 'Relationship' record in step 2 is probably querying from the wrong table.  This should get you what you need.

1)  Change your 'Queries from table' value to query from the 'Relevant document detail [cxs_rel_doc_detail]' table.

2)  Use this for your 'Query with' script

(function refineQuery(current, parent) {

	// Query for relevant docs
	current.addQuery('relevance', 'This helped');
	current.addQuery('relevant_doc', parent.sys_id);
	current.addNotNullQuery('relevant_doc');

})(current, parent);

3)  Configure your related list layout to include the 'Relevant Document.Relevant To' field and remove anything else you don't need.  You should end up with something that looks like this.

find_real_file.png

Thank you so much Mark. Also feeling so grateful for your reply on this. 

Thanks again

You're welcome!