Getting Error Data Policy Exception: The following fields are read only: Created in approval table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2019 03:35 AM
Hello ,
I am getting a Error when trying to create a approval record to a existing RITM .
gr.initialize();
gr.state = 'requested';
gr. = newUserId // variable to extract user id
gr.sysapproval=req.getUniqueValue();
gr.insert();
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2020 11:26 PM
Hello Saggi,
The idea behind read-only data policies is exactly that: restricting write access based on the conditions you set. So, if there you set no conditions whatsoever, then you won't be able to write, unless you explicitly force it with a script.
Whenever you create a new record, what it does is system writes to that field as well, hence the error.
What you can do is create an equivalent ACL and give role-based access. Or, if all you need is client-side restriction, you can just go ahead and use a UI policy.
You can refer the below link as well
Link 1 Data Policy Exception: The following fields are read only:
Link 2 Data Policy Behaving incorrectly
Regards,
Abhijeet