changes the State from 'Draft' to 'Ready' all the fields in the form should become mandatory.

siva58
Tera Contributor

i am created a form in one table with several fields. the requirement is 

  1. As user changes the State from 'Draft' to 'Ready' all the fields in the form should become mandatory
  2. There should be a Note/Tooltip for the user when the change the state from Draft to Ready, to notify them that all the fields are mandatory.

can any one help me in this case......

2 REPLIES 2

Aman Kumar S
Kilo Patron

You can create a UI policy to handle this

Condition : state is ready

Add UI policy actions for the fields and set Mandatory as true 

Also add in run script:

g_form.addInfoMessage("Fields are mandatory")

Best Regards
Aman Kumar

SumanthDosapati
Mega Sage
Mega Sage

You can write an UI policy or an OnChange Client script.

If UI Policy :

Set condition as state is 'Ready'

In Script tab in 'Execute if True' :

g_form.addInfoMessage("All fields are mandatory in Ready state");

In Execute if false :

 g_form.clearMessages();

In UI Policy actions set all required fields mandatory.

 

 

If with client script :

Type : OnChange

Field : state

script:

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
  return;
}

if(newValue == 'ready')
{

       var fields = g_form.getEditableFields();


       for(i=0; i<fields.length; i++){


               g_form.setMandatory(fields[i],true);



       }
}




}

 

Mark as correct or helpful as applicable.

Regards,

Sumanth