- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2022 07:44 AM
On the below form, the 'Edit' button appears within the 'Knowledge' related list:
However, I only want to make the 'Edit' button available for the current record if the user is either the 'Architecture lead(owner)', 'Domain Steward' or a member of a particular group.
What would I need to add to the List Control?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2022 06:10 AM
I've managed to do this by using 'List Control' and applying a script that checks if the current users has the required role and then if they are set in the one of the fields on the form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 12:37 AM
Hi
Even when I impersonate a user that is selected as the Domain Steward or Architecture lead(owner) for the current record, the edit button doesn't appear. My code is:
answer = checkCondition();
function checkCondition(){
var title = gs.getUser().getRecord().getValue('title');
if(title == 'Domain steward' || title == 'Architecture lead (Owner)' || gs.getUser().isMemberOf('Architecture Domain Admin'))
return false; // show it
else
return true; // omit it
}
I also have 'Omit is empty' selected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 12:54 AM
Hi,
what does this mean?
user that is selected as the Domain Steward or Architecture lead(owner) for the current record
I have assumed that is user's title. Is it correct understanding?
OR is there any field on your current form which holds that information?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 01:22 AM
Hi
The 'title' appears on the sys_user table, which is different.
Can you dot walk on fields on the form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 02:23 AM
Hi,
Are these 2 fields on form "Domain Steward" and "Architecture lead(owner)"?
if yes then update as this
Ensure you give correct field name from Knowledge table which holds Architecture record
Also give correct field name for Domain Steward and Architecture lead(owner)
answer = checkCondition();
function checkCondition(){
var leadUser = parent.u_architecture.u_architecture_lead;
var domainUser = parent.u_architecture.u_domain_steward;
var loggedInUser = gs.getUserID();
if(leadUser == loggedInUser || domainUser == loggedInUser || gs.getUser().isMemberOf('Architecture Domain Admin'))
return false; // show it
else
return true; // omit it
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2022 10:57 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader