I want to implement a case in which incident should not get saved unitl and unless a kb is attached

PriyanshuS64936
Kilo Contributor
//This should be only when assignment group is service desk.
//Here's the code I have written but when using this , it is throwing the error even after attaching the kb
 
 
function onSubmit() {
var kb=g_form.getValue('knowledge_base');
var assignmentGroup = g_form.getDisplayValue('assignment_group');

if (assignmentGroup && assignmentGroup.toLowerCase() ==='service desk'){
if (!kb){
g_form.addErrorMessage('You must attach a <b>Knowledge Base</b> before saving this incident');
return false;
}
}
return true;
}
 
 
0 REPLIES 0