mandatory field in task and Hidden on the Catalog Item

Nawal
Mega Guru

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.

find_real_file.png

 

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 

1 ACCEPTED SOLUTION

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);
}
}
-Anurag

View solution in original post

9 REPLIES 9

Anurag Tripathi
Mega Patron
Mega Patron

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

 

-Anurag

Hi anurag, 

this field (select box) should be visible only on a specific task. 

 

 

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.

 

-Anurag

Ok i will try this and let you know 🙂 

thank you