- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2017 12:01 AM
Below is the script written in UI policy to make fields as mandatory based on condition, how to write this in data policy, since it cannot be
converted since UI script is running a script.
UI policy code:
var fields = g_form.getEditableFields();
for (var x=0; x < fields.length; x++){
if (fields[x] != 'sys_created_on' && fields[x] != 'sys_created_by' && fields[x] != 'sys_updated_on' && fields[x] != 'sys_updated_by')
g_form.setReadOnly(fields[x],true);
}
Solved! Go to Solution.
- Labels:
-
Problem Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2017 12:15 AM
This is not possible as far as I understand on Data policy
But you can try to do the same via a business rule on the table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2017 03:22 AM
Create a tablename.* ACL.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2017 12:23 AM
Hello Suryan,
If I would want to use the scripts to make any field level security, I would prefer doing it writing ACLs. As this would serve both the purpose for you.
Regards,
Gaurav Talreja

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2017 12:25 AM
ACL security and making fields mandatory are 2 different things?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2017 12:34 AM
Hello Kalai,
Yes, you are right to make the field mandatory with the scripts, Business rules what would be needed in this case, which runs on the server side and perform the validation before submit/update. But to make any field read only I would still prefer the ACL. (which of course not the case here.)
Regards,
Gaurav Talreja