- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 11:20 PM
Hi All,
What should be the correct script format for the highlighted one? I am trying to map the sys_id and then allow access for the user to see the records
var answer = false;
var recPrdcr = gs.getProperty('u_case.recordproducer.name'); //Property returning sys_id of the Catalog Item
if (gs.getUser().hasRole('case_reader_gbslogissue') && current.u_catalog_item == 'recPrdcr') {
answer = true;
}
Regards,
Saurabh Chatterjee
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 11:48 PM
Hi @chatsaurav19,
The variable object should be without quotes.
Try this updated scripts:
var answer = false;
var recPrdcr = gs.getProperty('u_case.recordproducer.name'); //Property returning sys_id of the Catalog Item
if (gs.getUser().hasRole('case_reader_gbslogissue') && current.u_catalog_item == recPrdcr) {
answer = true;
}
If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers.
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 11:26 PM
For applying the second filter, I believe you are checking the catalog item, you can use the filter condition available on the ACL form and rest looks good.
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 11:42 PM
Hi @Prince ,
Actually I cannot use a filter condition since this ACL is used by many other applications plus this would become mandatory condition for the ACL to execute.
Regards,
Saurabh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 11:48 PM
Hi @chatsaurav19,
The variable object should be without quotes.
Try this updated scripts:
var answer = false;
var recPrdcr = gs.getProperty('u_case.recordproducer.name'); //Property returning sys_id of the Catalog Item
if (gs.getUser().hasRole('case_reader_gbslogissue') && current.u_catalog_item == recPrdcr) {
answer = true;
}
If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers.
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 11:51 PM
Update script as:
var answer = false;
var recPrdcr = gs.getProperty('u_case.recordproducer.name'); //Property returning sys_id of the Catalog Item
if (gs.getUser().hasRole('case_reader_gbslogissue') && current.getValue("u_catalog_item") === recPrdcr) {
answer = true;
}
Aman Kumar
