- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2018 08:49 AM
Hey guys,
I am trying to figure out a bug in my code. Can someone tell me what property does the canReadRecord method check against, on a catalog item to return a true or a false value? I have checked roles, available for, not available for on the catalog item, but they don't seem to have any effect on the outcome. Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2018 09:27 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2018 08:55 AM
Can you share code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2018 08:59 AM
Hey Mike, this is the code. I have bolded the if statement with the canReadRecord
while (catalog_items.next()) {
if (!$sp.canReadRecord("sc_cat_item", catalog_items.sys_id.getDisplayValue()))
continue; // user does not have permission to see this item
var item = {};
item.name = catalog_items.name.getDisplayValue();
item.short_description = catalog_items.short_description.getDisplayValue();
item.picture = catalog_items.picture.getDisplayValue();
//Item Price handling for dollar currency, so that the $0.00 check in the HTML can evaluate to true if prize is 0
item.price = catalog_items.price.getDisplayValue();
item.price = item.price.substring(item.price.indexOf('$'));
item.sys_id = catalog_items.sys_id.getDisplayValue();
items.push(item);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2018 09:27 AM
Fixed! It was an sc_cat_item read ACL. I had to add the role there