Is it possible to make a field de-facto mandatory with server-side script? (Tokyo)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2023 10:11 AM - edited 02-13-2023 10:14 AM
Hello, people.
I'm trying to convert the client-side scripts in my UI actions to server-side scripts in order to go around some ACL (which exists because of business requirements). However, I'm having trouble with one particular UI action that does the following:
This UI action changes the state to "On hold" and makes the "Work note" field mandatory, so the user would always have to provide a reason for placing a task on hold.
I looked it up, and there doesn't seem to be any way to render a field mandatory via server-side scripts.
Does anyone have any idea how I can recreate the action with server-side scripts and other methods?
Thank you in advance!
(For those who are interested in why I absolutely have to switch to server-side scripts: One of the business requirements is that the users should not be able to modify the "State" field directly, but may only do so via UI actions. However, I discovered that, if I try to achieve this by creating new ACLs, these ACLs would prevent the user from modifying the "State" field if the UI actions use client-side scripts. So I have to go around the ACLs by replacing client-side scripts with server-side scripts.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2023 07:45 PM
Could still be a client ui action, just have it call ajax or use server after the initial client checks.
You could require a prompt upon clicking to enter data into a popup, which will then save it to the work_note if populated and not canceled. Upon that it can call glideajax or call serverside script to change the state.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2024 01:58 PM
Hi,
usually we cannot make field mandatory from server side cause as they run on client side.
but we have another way
1) make sure the field value is empty or not in server side.
2) if it is then throw an error that the field is mandatory.
example: //if state is new
{condition: current.sate == '1'}
(script - UI Action)
current.state=='3';
current.update();