UI Action is giving "Invalid Update" when trying to change a field on a form

Shant Cancik
Tera Contributor

I'm building a change request process. I have a state field that turns to "Implementing" when the user submits the change request form.

I'm trying to create a UI Action Form button called "Work Complete" that when clicked on, updates the state from "Implementing" to "Closed". The workflow in the background is waiting for state to be closed to complete the workflow.

Here's my script for my UI Action. It gives me "Invalid Update" when I click on it. Any clues as to what I'm doing wrong?

action.setRedirectURL(current);

current.state=3;

current.update();

The value for "Closed" for state is 3 and it does actually update state on my screen so I know that's working correctly, but I get the "Invalid Update" error and my workflow does not move along.

Any help would be tremendously appreciated!

3 REPLIES 3

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Shant,



"Invalid update" is generally seen on the screen when you have a business rule on the current table which aborts the record update as per some logic. Please check for the same on your instance i.e check for code contains current.setAbortAction(true)


drasamsetti
Kilo Expert

Hello Shant,



As good practice set the stage value of that workflow as well to "Closed Complete" in your UI Action script.


Coming to "Invalid Update", it can also be from ACLs, if the logged in user not allowed to write to the Change state value Check for any ACLs and meet all the checks for those ACLs.


-Durga.


PS: Hit like, Helpful or Correct depending on the impact of the response


jesusemelendezm
Mega Guru

Hi Shant, did you find out what was the problem?