How to set variable to Read only on Task1, once task closed, Set it to mandatory and visible for all other tasks

Akshaya14
Tera Contributor

Hi All,

In flow designer I have 2 catalog task in task 1 all variables should be read only , after close the task another task is created here the variable should be editable. Tried UI policy as well.

 

Please advice!

Thank you!

1 ACCEPTED SOLUTION

Musab Rasheed
Tera Sage
Tera Sage

Hello,

Write onload client script like below, Make sure you add 'short description' which exactly points to Task 1 only....

function onLoad() {
var short =g_form.getValue('short_description');
if(short =='This is task1')                                                               
{
 g_form.setVariablesReadOnly(true);
 }
}

Mark my answer as correct if that helps

Regards

Please hit like and mark my response as correct if that helps
Regards,
Musab

View solution in original post

5 REPLIES 5

Harish KM
Kilo Patron
Kilo Patron

Hi you can write a onload client script on sc task table and look for closed state value 

 

var state = g_form.getValue('state');// closed state value

if(state == '2' )

{

 g_form.setVariablesReadOnly(true);

}

 

Regards
Harish

Thank you, This is also working

Musab Rasheed
Tera Sage
Tera Sage

Hello,

Write onload client script like below, Make sure you add 'short description' which exactly points to Task 1 only....

function onLoad() {
var short =g_form.getValue('short_description');
if(short =='This is task1')                                                               
{
 g_form.setVariablesReadOnly(true);
 }
}

Mark my answer as correct if that helps

Regards

Please hit like and mark my response as correct if that helps
Regards,
Musab

Hi Musab Rasheed,

Thank you this script working fine but I have Mandatory field it should be update  only in task 2 in task 1 it should be readonly.