- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2018 12:00 AM
Hi,
if Knowledge Base is IT then only display attachment icon, other wise except IT icon should not visible to any other Knowledge base records...
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2018 02:15 AM
hi, There might be a better way to should write a client script based on onChange function. Below is an example in the form of a screenshot and a code:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
var checkValue = g_form.getDisplayBox('kb_knowledge_base').value;
if (checkValue == "IT"){
g_form.disableAttachments();
} else {
g_form.enableAttachments();
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2018 12:55 AM
Chanikya,
Let me know still your facing the issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2018 12:56 AM
it is working fine here as per Below Script
client Script: OnLoad
var gr=g_form.getReference('kb_knowledge_base');
if(gr.title!='IT')
{
g_form.disableAttachments();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2018 12:59 AM
glad to here that helped to can you please mark it as correct if you are ok with that.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2018 02:15 AM
hi, There might be a better way to should write a client script based on onChange function. Below is an example in the form of a screenshot and a code:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
var checkValue = g_form.getDisplayBox('kb_knowledge_base').value;
if (checkValue == "IT"){
g_form.disableAttachments();
} else {
g_form.enableAttachments();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2018 11:27 AM
Hi,
Thanks for your reply...
why should we remove this if -condition script like , please explain me about it
if (isLoading || newValue === '') {
return;
}