Harsiddhi vadher
Harsiddhi vadher

Reputation: 1

Data Category Visibility Issue

I am facing Data Category visibility related issue.

The scenario is i'm following - I have One Community User which one is using for login into my community. This User's role is Inheriting Visibility for Category Group from it's parant role and it's Visibility is No categories are visible to parent role and subordinates. But This User's Permission set have Custom Visibility Permission is like - All Category Group > child Category > sub child Category for ex : All Products > Computers > Laptops

And I am accessing lick bellow query from apex to display related article in community.

Select Id, Title, KnowledgeArticleId, Summary, CreatedDate, UrlName From KnowledgeArticleVersion WHERE Language = 'en_US' and PublishStatus='Online' WITH DATA CATEGORY Products at (Computers__c) limit 10 UPDATE VIEWSTAT

but I am not getting any articles.
getting error like -- 

Invalid data category name provided: Products. There is no data category matching the given developer name on the data category group: Computers__c

If anyone have solution for this please let me know.

Thank you, Harsiddhi.

Upvotes: 0

Views: 1191

Answers (2)

Bismay Mohanty
Bismay Mohanty

Reputation: 1

Queries are not dependent on permission sets.

The error in the SOQL query can be looked upon at the query editor. Whenever there is a wrong API name in the query, there comes down an indication in the Query Editor under Developer Console that:

No such column 'field_name' on entity

Thus we can look back at the object fields and relationships and can ensure if the right API name is there.

Upvotes: 0

Aaron
Aaron

Reputation: 1

You probably have already figured this out by now, however you need to use the API name for your Group as well, i.e. 'Products' becomes 'Products__c'.

Should be something more like this:

Select Id, Title, KnowledgeArticleId, Summary, CreatedDate, UrlName From KnowledgeArticleVersion WHERE Language = 'en_US' and PublishStatus='Online' WITH DATA CATEGORY Products__c at (Computers__c)

Upvotes: 0

Related Questions