Mandatory field on the Kb article

Pierre Midro
Tera Contributor

Hello to all,

I have a customer need
On the kb_knowledge_base.list table I have created a custo field (u_mandatory_ownership_group) of type (true /false)
When creating a knowledge base Kb, if this field is checked to true, make the field ownership group (ownership_group) which is on the table of articles: kb_knowledge.do to mandatory and if it is not checked to true, do not make it mandatory.
Attached are the screen shots of the two tables
Thank you for any suggestions.

Regards

Midro

 

1 ACCEPTED SOLUTION

SumanthDosapati
Mega Sage
Mega Sage

Hi @Pierre Midro 

You can simply write a UI policy on knowledge article table (kb_knowledge) as below screenshot

find_real_file.png

 

Instead of selecting Knowledge base.Active  is  True

Select your custom field like  Knowledge base.Mandatory Ownership   is   True

 

In UI policy actions, Set your ownership_group as mandatory.

 

Mark it as correct if it worked.

Regards,

Sumanth

View solution in original post

6 REPLIES 6

SumanthDosapati
Mega Sage
Mega Sage

Hi @Pierre Midro 

You can simply write a UI policy on knowledge article table (kb_knowledge) as below screenshot

find_real_file.png

 

Instead of selecting Knowledge base.Active  is  True

Select your custom field like  Knowledge base.Mandatory Ownership   is   True

 

In UI policy actions, Set your ownership_group as mandatory.

 

Mark it as correct if it worked.

Regards,

Sumanth

Tapish Sharma1
Kilo Sage

Hi,

You can create a UI policy for Knowledge article ,

In conditions you can add-

Knowledge base.Ownership group is true 

and then create a UI action and make Ownership Group field mandatory

 

kindly mark correct/helpful if this answered your query

Pierre Midro
Tera Contributor

@Tapish Sharma

@Sumanth Dosapati 

 

 Thanks for your quick reply, I tried it with a UI policy but the field becomes mandatory after submission and I want it before
Here is the code used in the script:

Ui policy : Set mandatory 

Condition : kb.u_mandatory_ownership_group is true

Run script: 

function onCondition() {
var box = g_form.getValue('u_mandatory_ownership_group');
var answer = true;
if (box == true) {
g_form.showFieldMsg('u_mandatory_ownership_group', 'Please fill in the field', 'error');
answer = false;
}

g_form.submitted = false;

//Abort the submission
return false;
}

 

 

UI policy will not execute when form is submitted.

It works onLoad (that check box needs to be checked) and onChange.

 

can you share the ui policy screenshot with Knowledge base.Mandatory Ownership   is   True  condition