- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2022 11:21 PM
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
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2022 11:58 PM
Hi
You can simply write a UI policy on knowledge article table (kb_knowledge) as below screenshot
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2022 11:58 PM
Hi
You can simply write a UI policy on knowledge article table (kb_knowledge) as below screenshot
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2022 12:00 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2022 02:22 AM
@Tapish Sharma
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;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2022 02:39 AM
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