- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2016 11:09 AM
Hi,
I am creating an ACL script to prevent users with a custom role from viewing more than the records that they have created. I need to check the field in my table, user, to see if it is equal to the current logged in user. The user value is stored in my table as their display name rather than sys id, so I am using gs.getUserDisplayName(); to compare their values. I have seen examples of people using current.field_name to access information from a record, but I am still unsuccessful. Attached below is what I am currently working with. Please comment if you have any recommendations. Thank you!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2016 12:05 PM
Hey Runna,
Change the drop down value in name field to "None" and it should work. Please refer below screenshot and let me know if you are blocked.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2016 11:21 AM
Hi Runna,
Could you should the condition you're currently using. You should be able to do something like this in the condition builder or script box though:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2016 11:33 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2016 11:36 AM
Hi Runna,
If the reference field is a user reference, then you don't need any scripting, just do this:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2016 11:38 AM
From your question it seems that you should be using gs.hasRole instead of the function to get displayname.