You need to sign in to do that
Don't have an account?
pilli brahmananda
how to write a test class knowledge__DataCategorySelection and knowledge articles
please help me how to write a test class in knowledge__DataCategorySelection and knowledge articles
Hope you must have figured it by now. You have to write it for individual KNowledge Article Types like, Article_kav, FAQ_Kav, etc. and Similary Article__DataCategorySelection, FAQ__DataCategorySelection.
Example:
FAQ__kav newFAQ = new FAQ__kav();
newFAQ.Title = 'test1';
newFAQ.UrlName = 'test1';
insert newFAQ;
FAQ__DataCategorySelection newFAQDC = new FAQ__DataCategorySelection();
newFAQDC.DataCategoryGroupName = 'Knowledge_Categories';
newFAQDC.DataCategoryName = 'General';
newFAQDC.DataCategoryGroupName = 'Geography';
newFAQDC.DataCategoryName = 'North_America';
newFAQDC.DataCategoryGroupName = 'Internal';
newFAQDC.DataCategoryName = 'Unrestricted';
newFAQDC.ParentId = newFAQ.id;
insert newFAQDC;