- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 01:40 AM
requirement is:
i am using 2 fields,
- Employee type (true/false type).
- Category (choice field. L1-1,L1-2,L1-3,,, default value is L1-1.
So, my requirement is if i select the Employee type as True, then category field display the choice as L1-3, and read only.
if i select employee type as false then category field display the choice is L1-1, and editable.
How to get this functionality ,,, if possible using ACL..
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 02:57 AM - edited 10-30-2023 02:59 AM
Write onload client script and onchange with above script it will work.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 01:50 AM
Hi @VSN ,
ACL its not possible only we can achieve this through onchange client script on Employee Type field.
(function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var employeeType = g_form.getValue('employee_type');
if (employeeType === 'true') {
g_form.setValue('category', 'L1-3');
g_form.setReadOnly('category',true);
} else {
g_form.setValue('category', 'L1-1');
g_form.setReadOnly('category',false);
}
})(control, oldValue, newValue, isLoading, isTemplate);
Please mark it as solution proposed and helpful if this serves your purpose.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 02:35 AM
it is working for only new record, after saving the form category field is editable even category is L1-3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 02:57 AM - edited 10-30-2023 02:59 AM
Write onload client script and onchange with above script it will work.
Thanks,
Anand