Make fields readonly and also editable on clicking UI action

maneesh3
Tera Contributor

Hi Team,

 

Need help in following requirement:

 

Make fields read-only (Assigned To and Assignment group) once filled in Case form and once users click on Transfer button, then Assigned To and Assignment group editable so that users can transfer ticket to other team.

 

I have written UI policy and UI action and assuming because of UI policy , UI action code not working to make fields editable.

Kindly suggest.

 

Thanks,

 

5 REPLIES 5

@maneesh3  You can set the field value to empty in UI action right.

 

function runClientCode(){

 

g_form.setValue('u_reason_for_transfer','');


g_form.showFieldMsg('u_reason_for_transfer','Reason for Transfer is Mandatory before transferring','error');

g_form.setMandatory('u_reason_for_transfer','true');
g_form.setReadOnly('assignment_group', 'false');

 

 

return false; //Abort submission


}

 

//Call the UI Action and skip the 'onclick' function


gsftSubmit(null, g_form.getFormElement(), 'submit_t_form'); //MUST call the 'Action name' set in this UI Action

current.update();
}

 

 

If my answer solved your issue, please mark my answer as Correct & 👍Helpful