- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 10:13 PM
Hi,
I want to find a reference from ServiceNow OOTB button and utilize it, but cannot figure what to use.
Below is what I want to make.
1. In the requested item (sc_req_item), I will use short description, description.
2. I want to create a button named "Make Knowledge" next to Save (Submit).
The Function of "Make Knowledge" is mapping the requested item's short description and description to Knowledge FAQ table's Short Descriptions and Questions.
I think the similar button already exist in ServiceNow, but I cannot find what it is.
Is there anyone who can help me?
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 10:31 PM
Hi @ParkHyunSun ,
You can create a one:-
1. Navigate to System UI > UI Actions in ServiceNow.
2. Click on New to create a new UI action.
3. Fill in the mandatory fields:
- Name: Make Knowledge
- Table: sc_req_item
- Action name: make_knowledge
- List v2 Compatible: true (if you're using List v2)
- Form button: true
- Client: true
4. In the script section, you could write something like this:
function onClick() {
var gr = new GlideRecord('kb_knowledge');
gr.newRecord();
gr.short_description = g_form.getValue('short_description');
gr.text = g_form.getValue('description');
gr.kb_knowledge_base = 'Your Knowledge Base sys_id';
gr.kb_category = 'Your Category sys_id';
gr.workflow_state = 'draft';
gr.update();
gs.addInfoMessage('Knowledge Article Created');
action.setRedirectURL(current);
And you can also refer the link below:
https://docs.servicenow.com/bundle/vancouver-servicenow-platform/page/product/knowledge-management/t...
Thanks and Regards,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 10:31 PM
Hi @ParkHyunSun ,
You can create a one:-
1. Navigate to System UI > UI Actions in ServiceNow.
2. Click on New to create a new UI action.
3. Fill in the mandatory fields:
- Name: Make Knowledge
- Table: sc_req_item
- Action name: make_knowledge
- List v2 Compatible: true (if you're using List v2)
- Form button: true
- Client: true
4. In the script section, you could write something like this:
function onClick() {
var gr = new GlideRecord('kb_knowledge');
gr.newRecord();
gr.short_description = g_form.getValue('short_description');
gr.text = g_form.getValue('description');
gr.kb_knowledge_base = 'Your Knowledge Base sys_id';
gr.kb_category = 'Your Category sys_id';
gr.workflow_state = 'draft';
gr.update();
gs.addInfoMessage('Knowledge Article Created');
action.setRedirectURL(current);
And you can also refer the link below:
https://docs.servicenow.com/bundle/vancouver-servicenow-platform/page/product/knowledge-management/t...
Thanks and Regards,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 10:43 PM
Hi the docs you gave me helps a lot!
Thank you!