- 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 11:42 PM
OnChange client script sometimes may be used both at form loading, and at change of fields. Deleting this block allows you to use two events simultaneously
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2018 02:54 AM
Hi,
Please add below code in your onLoad client script.
var kb_base = g_form.getDisplayVlaue('database name of knowledge base field');
if(kb_base!='IT'){
g_form.setVisibility('database name of attachment button',false);
}
else{
g_form.setVisibility('database name of attachment button',true);
}
Please mark this answer as correct/helpful if it helps you .
Regards,
Manjusha