0

I have inserted articles but now i have to assign data category and sub category to it.Article records are upto 200.Manually assigning category is not the feasible way to do. Could anyone suggest me how to assign it through data loader?Thanks in advance.

2 Answers 2

0

You can run an Update with Data Loader on the existing article records. Alternatively, if the logic for assigning the categories is derived from object data, you can use Apex.

2

You could use Article Type__DataCategorySelection

Something like: (where Download__ should be replaced with your article type name)

public Download__DataCategorySelection assignDataCategoryToDownload(ID articleId, String DataCategoryGroupName, String DataCategoryName){
    Download__DataCategorySelection dataCategory = new Download__DataCategorySelection();
    dataCategory.ParentId = articleId;
    dataCategory.DataCategoryGroupName = DataCategoryGroupName;
    dataCategory.DataCategoryName = DataCategoryName;
    return dataCategory;
}  

Then you should use Insert to apply the results (preferably in batch).

For more information check: https://www.salesforce.com/developer/docs/api/Content/sforce_api_objects_articletype__datacategoryselection.htm#sforce_api_objects_articletype__datacategoryselection

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .