gs.getUserID() acl for read
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2017 03:08 AM
Hi Guys
I am having some trouble with ACL. I have two list fields. A watch list and custom list field.
My acl are like this. The only two not working is the list type fields using javascript:gs.getUserID()
Can anyone help?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2017 03:23 AM
Hi Brendan,
You can use the script portion of the ACL to check on the Watch list and the Trainee List:-
var list = current.watch_list.toString();
var array = list.split(",");
for (var i=0; i < array.length; i++)
{
if(gs.getUserID() == array[i]));
{
return true;
}
return false;
}
And similarly for trainee list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2017 04:01 AM
thanks subhajit
I tried that and was getting errors on code.
I have also tried the following but to no avail. My scripting is very limited, apologies.
var list1 = current.watch_list.toString();
var list2 = current.x_pfgb3_vendormgmt_training_request.trainee_list;
list1.push(list2);
var arr = list1.split(",");
for (var i=0; i < array.length; i++) {
if(gs.getUserID() == array[i]) {
answer = true;
}
}
answer = false;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2017 04:38 AM
Hi Brendan,
Can you please share what kind of errors you are seeing in your code, screenshots would be great.
Also, if you are using scripts, you will need to have the whole condition matching to be done through Scripts as i see all the conditions are in the OR clause.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2017 05:14 AM