- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2023 04:22 AM - edited ‎04-30-2023 04:23 AM
Hi all,
We have two OOB activities in ServiceNow
The 1st activity is like : when 'Incident state' is resolved/closed then resolution notes & code is mandatory which running under data policy.
2nd activity is like : whenever we make 'Incident state is closed/resolved' then resolution code & notes are made read only which running under UI policy.
My query is like: Instead of maintiang 2 activities like first one with data policies and the second one with UI policies tables , Can we configure the first activity in UI policies table and can control the behaviour of state field !
Please explain me' ' why those are running in 2 different tables for 'state field' on the same incident form?
why they are introduced/created a 'data policy' for first activity even UI policy is avialble for form level validations?
Please assist me the best example / explanation.
thanks
PTR
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2023 08:45 AM
@PTR - incident table extends the task table, hence these fields are inherited.
To replicated to data policy error, please create a data source along with transform map(uncheck the run business rules)
To the data source,attach a excel sheet which contains the incident records to be inserted and then click on 'load all records' ui action link and then click on run transform --> click 'Transform' --> click 'Transform History'
You'll see that there are errors, all related to data policy exception
I've attached the excel with this message, you can leverage that.
If my answer has helped with your question, please mark it as helpful and accepted solution.
Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2023 06:08 AM
Hi @PTR ,
The reason that 1st activity is configured as a data policy and not a ui policy is because data policies are executed on the server and applies to all the data entering into the system, including data brought in through email, import sets or web services and data entered through the mobile UI.
Suppose you decide to import a bunch of incidents (state = closed/resolved) via excel import and resolution code and notes are not included in the excel, so, while importing them you'll get a data policy exception, something like this:
We cannot achieve the same with UI policy since it only runs when the form loads or while field changes on the form.
Few notable points regarding Data Policies and UI policies are as follows:
1. UI policies only apply to data entered on a form through the standard browser. Data policies can apply rules to all data entered into the system, including data brought in through email, import sets or web services and data entered through the mobile UI.
2. UI Policy will work only on the form but not on List view, but if you create a data policy to make a field mandatory based on some value, it will also work in list view as well.
3. Data Policies,executes on the server whereas UI policies sits in the browser's memory and is triggered when the form loads or some field changes
4.You cannot make a field visible or hidden using data policies
5. Data Policies can be converted to UI policies and and vice-versa is only true when certain conditions are met.
If you check the OOB data policy for close code/ notes on incident, the checkbox 'use as UI policy on client' is selected to make it run on form as well.
Please go through this official doc as well : https://docs.servicenow.com/en-US/bundle/utah-platform-administration/page/administer/field-administ...
If my answer has helped with your question, please mark it as helpful and accepted solution.
Thanks,
Karan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2023 03:22 AM - edited ‎05-01-2023 08:26 AM
As per your reply, Even the "Resolution code and notes' fields are configured at the incident form level, but the behaviour of controlling those fields is determined by data policy. bcz of this reason, we should not use UI Policy for 1st acitvity (when 'Incident state' is resolved/closed then resolution notes & code is mandatory). correct?
thanks
PTR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2023 08:45 AM
@PTR - incident table extends the task table, hence these fields are inherited.
To replicated to data policy error, please create a data source along with transform map(uncheck the run business rules)
To the data source,attach a excel sheet which contains the incident records to be inserted and then click on 'load all records' ui action link and then click on run transform --> click 'Transform' --> click 'Transform History'
You'll see that there are errors, all related to data policy exception
I've attached the excel with this message, you can leverage that.
If my answer has helped with your question, please mark it as helpful and accepted solution.
Thanks!!