
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2018 06:51 PM
I have a UI action that runs server-side to update the state of a reocrd. The script is very simple:
moveToImplemented();
function moveToImplemented(){
current.state = 2;
current.update();
action.setRedirectURL(current);
}
My question is, will this automatically validate that mandatory fields in the previous state are populated? I was always under the assumption that it did, based on testing and observation clicking the button gave me an error message if I left mandatory fields blank. However, I ask because we recently had one case where a user somehow got to this new state without populating the mandatory fields.
Actually, this user says that they did indeed fill in all the mandatory fields, and update via the UI Action button, but there is no indication in the audit history that any of those fields were ever set. I'm very confused as to how it would even be possible to leave those fields blank, as every attempt to reproduce the issue has shown the expected result.
Solved! Go to Solution.
- Labels:
-
User Interface (UI)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2018 03:28 PM
Hi Chris,
The form are being loaded on Client side and it is browser/machine/internet connection speed dependent.
E.g. Form and all local javascript component not being fully loaded before your user start typing into the fields and press submit. Loading of the form are also depends on internet connection speed as well as machine condition at that point of time.
There could be more scenario where browser screw up the data being post to server, connection timeout on client side etc...
As such, if the objective is not to end up in this state, suggest to put in additional explicit check before you update the record just to be safe.
Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2018 07:13 PM
hi Chris,
It depends on how the "mandatory fields in the previous state" were being implemented.
Perhaps u can try putting in an explicit check before you update the records to be safe.
just a thought and hope this helps.
cheers. 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2018 07:32 PM
It is being implemented with UI Policy. The condition on the UI policy is a simple state is one of approved, implemented, closed. Approved was the previous state and implemented is the new one so it should be mandatory in both.
I also do trust this user who says they did populate the mandatory fields, so I am thinking something else maybe blanked them out before the update but I don't know what. Or maybe it was a glitch in ServiceNow.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2018 03:28 PM
Hi Chris,
The form are being loaded on Client side and it is browser/machine/internet connection speed dependent.
E.g. Form and all local javascript component not being fully loaded before your user start typing into the fields and press submit. Loading of the form are also depends on internet connection speed as well as machine condition at that point of time.
There could be more scenario where browser screw up the data being post to server, connection timeout on client side etc...
As such, if the objective is not to end up in this state, suggest to put in additional explicit check before you update the record just to be safe.
Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2018 09:31 PM
Ok, thanks it does. I simply reported it as an isolated glitch this time, but if I ever see the issue again I will definitely consider your suggestion.