- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2016 11:30 AM
Hi All,
I have an onSubmit client script that alert's the user when they attempt to submit/update a Change Request to a specific 'state' and they do not have a required role. This seems to be working fine, however I wanted to add some logic where if the Change Request is already in that specific state, that they are able to save/update the record. We just don't want them to be able to submit or update to that state from a previous state. Hope that makes sense. any help is appreciated. Thanks everyone!
Fred
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2016 06:51 AM
Hi Fred,
Great work!
As far as I know, disableOption() is not a method/function that comes OOB. Using g_form.removeOption() is the most common way.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2016 11:36 AM
Hi Fred,
I cannot think of a good way to get the previous value and detect changes in the client script. It might make more sense to prevent the user from doing something potentially harmful in the first place rather than let them and warn them. This offers a better user experience.
Possible ideas:
How about an onLoad client script that checks if the user has a role and makes the state editable, otherwise read-only. Or if they don't have the role, remove the option, or hide the state if it's 10 and they don't have the role. That way they cannot change it, but it doesn't get changed either.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2016 02:31 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2016 12:21 AM
Have you added UI script for disableoption() ?
If not, Add it from below link from guru (Disabling/Enabling Options)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2016 03:48 PM