- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2015 09:36 PM
G'Day ServiceNow gurus,
We just migrated to Fuji and we are starting to play with the knowledge base databases in our development instance.
We have a knowledge template called "Systems new article" which basically fills the text underneath of the "Short description" with an HTML text. Now when I click "Create content" then I have to apply the template to get this default text as shown below
How can I make this template the default so I do not have to apply it ?
If I go to the general defaults then I can not place an HTML default in text
I appreciate any advice.
Kind regards
Carlos
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2015 10:40 PM
Two points:
- you can create a default template that is automatically applied when someone manually creates a new record on any table. You do this by saving the template with the same name as the physical table name, in your case "kb_knowledge". See Section 6 in this Wiki article - Creating a Template - ServiceNow Wiki.
- for your default HTML text, you cannot enter rich text in the text field so you need to enter the actual HTML markup text
Doing that will result in your Text field looking like this when you create a new record:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2015 06:04 PM
Hi Rashid,
Thanks for the comprehensive reply, In
Shahid Shah wrote:
- Navigate to Knowledge -> Knowledge Bases
- Select the Knowledge record
- In the Set default knowledge field values field select Text from the drop down and give it a value like "is it working?" (without the quotation marks)
I can not place an HTML default but even If I could then I can not place automatically as default
In the second part of your reply
Shahid Shah wrote:
You can get this to apply on load in a couple of ways:
- Create an onLoad Client Script with the code of applyTemplate('put the sys id in here');
- Create a new module under the Knowledge application (or another one) and in the Arguments add &sysparm_template= followed by the name of the template. Per this example the value would be &sysparm_template=MyKBTemplate.
I create this client script
but it is not working when I create a new template. Do you know why?
I also tried suggestion number 2 but I do not know "What Link Type" to use to combine with the arguments
I think that I am almost there just a bit of more extra help
Kind regards
Carlos

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2015 09:48 PM
Hi Carlos,
The sys_id you are using is not proper. Remove 'sys_template_' from the begining.
Or simply go to Templates > Right click on your template record and click copy sys_id.
So it will look something like this -
applyTemplate('8c12b7130a0a0a6400c5ed6df604d768');
Thanks,
Tanaji

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2015 09:52 PM
One more thing - This template will always get applied whenever you open the knowledge form irrespective of whether its a new record or an existing record.
If you want this to applicable only on new form then use below code -
function onLoad() {
if(g_form.isNewRecord()){
applyTemplate('8c12b7130a0a0a6400c5ed6df604d768'); //replace sys_id with yours
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2015 11:20 PM
Thanks Tanaji

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2015 11:21 PM
You are welcome