- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2022 07:04 AM
Hi,
i have a question regarding a field to be diplayed Mandatory only on a specific task.
I tried a simple ui policy but it forces display on the Item.
same if i check mandatory box!!
and also with a client script : g_form.setMandatory('variables.example', true);
Any idea how to do please?
thank you so much
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2022 08:41 AM
Hi,
Use this
function onLoad() {
//Type appropriate comment here, and begin script below
//task.u_task_name = "Build contract";
if(g_form.getValue('u_task_name')=="Build contract")
{
g_form.setMandatory('can_you_please_specify', true);
else{
g_form.setMandatory('can_you_please_specify', false);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2022 07:07 AM
Hi,
Not sure what you are stuck with. If you make a field mandatory, it has to be visible and editable, you cannot have a field that is not visible or not editable as mandatory.
Best way to control field behavior is ui policies, but yea you can do it via client script also if needed.
If its a catalog ui policy the be sure to check that it runs on task and ritm. There is a checkbox for that.
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2022 07:19 AM
Hi anurag,
this field (select box) should be visible only on a specific task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2022 07:25 AM
Ok, Then you can have a client script where you read the task title(or any other identifier) and base don that make the field display false and non mandatory or display true and mandatory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2022 07:49 AM
Ok i will try this and let you know 🙂
thank you