- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2025 08:36 AM
Hello Guys!
I have two different UI Actions, one called Defer:
The condition in Defer:
- gs.hasRole('demand_manager') && (current.state == 2 || current.state == 3 || current.state == -4)
And one called Reject:
The condition in Reject:
- ((gs.hasRole('demand_manager')) && (current.state == 8 || current.state == -4 || current.state == 3 || current.state == 2 || current.state ==-15)) || (gs.hasRole('demand_user') && current.state == -15)
The problem: The Reject button (marked in red below) redirects me to state 10 instead of state 7. So the UI Action called Defer works as it should, while Reject is not. Do you know what I'm doing wrong?
Thanks in advance.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2025 08:56 AM
Typically the state field is of type integer when it comes to the value. I'm surprised that the defer UI Action is working properly. You should be setting current.state = 7; instead of current.state = "7"; as the latter is converting it to a string instead of leaving it as an integer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2025 01:59 PM - edited 01-17-2025 01:59 PM
Rejected is an OOB state, and the type mismatch—while a valid concern from a database perspective—is fairly common, and should still work as expected. In fact, the OOB Reject UI action has the following script:
current.state = '7';
current.update();
action.setRedirectURL(current);
@ronro2 - It's been a while since I worked with Demand states, but I recall there are some state management BRs that need to be fully understood. Have you checked the audit history to see if the state value is changing to 7, and then to 10, in separate updates? It might be helpful to share the full UI action.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 03:52 AM
The solution was using different onclick-method names for the different buttons.