Create a UI action to enable creating knowledge articles from incidents
Share this page
Print
- UpdatedJan 30, 2025
- 1 minute read
- Yokohama
- Knowledge Management
Create a UI action to add the Knowledge check box to the Incident form.
Before you begin
Procedure
- Navigate to System UI > UI Actions.
- Click New.
-
Fill in the following fields.
Table 1. UI Action form Field Description Name Create Knowledge Table Incident Action name create_knowledge - Select the Client check box.
- Select the List v3 Compatible check box.
- Select the Form button check box.
- In the Onclick field, enter createKnowledgeClient().
- In the Condition field, enter gs.getProperty("enable_kcs_incident") == 'true' && new global.CSMTableMapUtil (current).findMapByName("incident_kcs_article") && new global.KBKnowledge().canCreate().
-
In the Script field, enter the following code.
function createKnowledgeClient() { if (g_form.modified) { alert(new GwtMessage().getMessage('You have unsaved changes. Please save them to continue.')); }else{ //Call the UI Action again but skip the 'onclick' function gsftSubmit(null, g_form.getFormElement(), 'create_knowledge'); //MUST call the 'Action name' set in this UI Action } } //Code that runs without 'onclick' //Ensure call to server-side function with no browser errors if (typeof window == 'undefined') CreateKnowledgeServer(); function CreateKnowledgeServer(){ current.update(); var map = new global.CSMTableMapUtil (current); map.findMapByName("incident_kcs_article"); var targetURL = map.getTargetURL(); if(targetURL) action.setRedirectURL(targetURL[0]); }