function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
yoshinagayoshinaga 

Does anybody know how to query data categories used by Answers in Apex?

I am building a Force.com site. and I need to query the data category used in Answers.

with salesforce.schema I confirmed that the data category group infomation can be queried from QuestionDataCategorySelection.

But It looks like no any table provide the categories info in that group.

Does anybody know how to query data categories used by Answers in Apex?

yoshinagayoshinaga

I have got  the answer in APEX reference.

To get information about data category, rather than using SQQL ,we have to achieve schema information as followings

describeCategoryStructureResult =
            Schema.describeDataCategoryGroupStructures(pairs, false);
 For details, please consult "Understanding Apex Describe Information" on "Dynamic APEX".