- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
We are currently using a State Model to control state transitions on the Problem table.
However, we have a requirement where we are updating the State using a Fix Script / Business Rule.
Due to the configured State Model, the update is being restricted and the record is not moving to the intended state.
So, I want to understand:
- Is it possible to bypass or override State Model restrictions through scripting?
- If yes, what is the recommended approach to achieve this?
setWorkFlow(false) - This is not working,
Any guidance or best practices would be helpful.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Sathwik1
Refer KB0759295 :System enforces the state transition (through com.snc.state_model.StateTransitionValidator) and does...
Issue
When the State Model and Transitions are enabled on a table ,System enforces the state transition (through com.snc.state_model.StateTransitionValidator) and does not allow transition of state through Business Rule / Script, if it does not validate against existing model transition.
Cause
This is an expected behavior as designed, The state transition will be enforced as configured for the table. System will not allow any invalid state transition on the record through the UI or script.
Please review > Add a state model and transitions
Resolution
If you want to allow the update on the state , through Business Rule / API Script, the following System property can be used to disable the "StateTransitionValidator"
com.glide.record.state.validation = false
If the property above is disabled system will not validate and allow transition to any state on the record that is done through the script / business rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
you can override that but I won't recommend doing that.
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
