Make fields readonly and also editable on clicking UI action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2023 02:56 AM
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,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2023 04:14 AM
@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