Set Mandatory Filed False on Form Update/Saved

Hamadullah
Tera Contributor

I want to make a mandatory field false want when the form is updated/saved.

 

if the "work notes" field is mandatory, it should false mandatory condition when the form is updated/saved (only for that particular transaction in the client, meaning only until the value is changed in the form and updated/saved after the record is updated it should no longer be mandatory.

 

Please share your valuable suggestions

1 REPLY 1

Rutuja Khalate
Tera Guru

Hi @Hamadullah ,

 

You can check the current ui action (Save or Update on which you want to apply this validation) in the onSubmit client script and set the fields mandatory based on conditions like below:

var action=g_form.getActionName();

if(action=='your_action_name'){

g_form.setMandatory('field_name', true);

}

if (g_form.getValue('field_name') == '')
return false;

Please mark this response as correct or helpful if it assisted you with your question.

Best Regards,
Rutuja Khalate