
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2020 02:29 AM
Hi Community
I have a problem with the OOB UI Action "Edit...". Condition of this UI action is:
(new GlideRecord(current.getTableName())).canCreate() && RP.isManyToMany() && !RP.getListControl().isOmitEditButton()
Now on my User Group table, I want that only the group owner can see and use the "edit" button on the related list "Group Members". Therefore I edited the list control and added following omit edit button script:
var answer = true;
if(current.group.manager == gs.getUserID() || gs.hasRole('admin')){
answer = false;
}
answer;
Now when a non-group-owner user opens the form, the edit button is omitted. If a group owner opens the form the edit is there but clicking it results in an "action not authorized". After investigating I know its the "!RP.getListControl().isOmitEditButton()" condition on the UI action. If I remove this everything works as expected.
Does anyone have an idea what's the cause?
Thank you in advance, regards
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2020 01:17 AM
Problem solved!
In a list control of related list access to the main record displayed on the form you need to use "parent", and not "current" like I did. "Current" refers to the first entry of the related list.
So following list control omit edit function works like desired:
var answer = true;
if(parent.manager == gs.getUserID() || gs.hasRole('admin')){
answer = false;
}
answer;
Thanks everyone 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2020 07:27 AM
I made an interesting observation. When I comment on the omit edit script on the list control it works as expected.
Not working -> action not authorized (admin user is working):
var answer = true;
if(current.group.manager == gs.getUserID() || gs.hasRole('admin')){
answer=false;
}
answer;
Working:
var answer = true;
answer;
What could be wrong with this script?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2020 01:17 AM
Problem solved!
In a list control of related list access to the main record displayed on the form you need to use "parent", and not "current" like I did. "Current" refers to the first entry of the related list.
So following list control omit edit function works like desired:
var answer = true;
if(parent.manager == gs.getUserID() || gs.hasRole('admin')){
answer = false;
}
answer;
Thanks everyone 🙂