workflow script - Set field Mandatory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2016 09:33 AM
Hello Experts,
Is it possible to set a field on the demand form mandatory through the workflow between tasks? Before task can be closed out, I want 'u_manager' field to be mandatory before a task can be closed. I cannot do this with a UI policy on demand form on state change, because this state has 3 different tasks, and u_manager field needs to be mandatory before the last task closed. Any ideas?
Basically after the 'confirm requested resources' task is completed, we need to set 'u_manager' mandatorybefore 'resources fulfilled' can be completed.
- Labels:
-
Scripting and Coding
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2016 10:45 AM
So we have a business rule running on multiple other tasks on task level that does a check to see if a field is filled in, and if it isn't it does not let you close the task, however, it does not make it mandatory on the form, for which we've used UI Policies. The only problem doing it on the task level is that you won't know to fill in that field unless you try to close it, and it gives you an error.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2016 10:02 AM
I have explained a method here to deal with such issues.
https://community.servicenow.com/message/997066#997066
Give it a try and let me know how it goes. I have tried it on my personal instance and so it should work just fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2016 10:14 AM
This is really nice but this high level code many people won't be figure out where to place.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2016 10:41 AM
Thanks for all the suggestions guys. This seems like an overkill for making a field mandatory from that point on for rest of the workflow. I do have an unique identifier 'task_code' for tasks, would it be possible to run a script on demand when 'Confirm Requested Resources' is 'Closed Complete'? Perhaps in the UI Policy advanced section?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2016 10:58 AM
This can be achieved in a simple way.
Create a ui policy and based upon the description make that manager mandatory.
Conditions:
State is Closed complete and Descirption is Resource Fullfilled