- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 05:12 AM
We have a custom table in a scoped application. And for simplicity sake, let's say we have two groups of that are important to this question: those with an "admin" role, and those with a "telecom" role.
On my custom table, we have a field name "site". I need to create an ACL on this field such that users with the Telecom role are able to add new records to the table (and can set EVERY field in the table). However, on existing records, I want to limit it so that only those with an "admin" role can edit the "site" field (so users with the Telecom role CANNOT edit the "site" field on existing records).
Can anyone tell me how I need to constructs my ACL(s) to do this?
Thanks
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 06:17 AM
OK, I figured it out. I had to add a new write ACL on the field in the table, add "Telecom" to the role, and add this to the Script section:
//allow edit ability on this field when creating new records only
answer = false;
if(current.isNewRecord()){
answer = true;
}
I knew it had to be something fairly simply, just took a whole to figure it out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 05:41 AM
I don't think I follow you. Are you saying in addition to the new ACL I created, or instead of? It seems to me that we should be able to do it via ACL.
If I have to use a Client Script, what exactly would that script look like?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 05:50 AM
In the existing ACL itself check if it is new record or not. To check if it is new record or not you need to get the URL . If that URL has sys_id -1 then you have to make that field editable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 06:01 AM
I am not sure which of the multiple ACLs you are referring to. And I do not know how to do what you are suggesting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 05:40 AM
I don't think I follow you. Are you saying in addition to the new ACL I created, or instead of? It seems to me that we should be able to do it via ACL.
If I have to use a Client Script, what exactly would that script look like?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 06:17 AM
OK, I figured it out. I had to add a new write ACL on the field in the table, add "Telecom" to the role, and add this to the Script section:
//allow edit ability on this field when creating new records only
answer = false;
if(current.isNewRecord()){
answer = true;
}
I knew it had to be something fairly simply, just took a whole to figure it out.