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
RomyRomy 

How to Assign Category and Subcategory to Solutions at ime of import using Solution Import Wizard

Categories appear as related list on solution detail page and to assign a category to solution we have to do it mannually for each solution on it's detail page. If I am importing 200 solutions through Solution Import Wizard, it will be very tedious to assign category mannually to each of them. I am wondering is there any way to assign category and subcategory to solution at the time of import. Solutions support the trigger functionality but I can't access any child field on category (under solution child relationships) through Salesforce Schema in Eclipse.

 

I'll appreciate if some one can help me figure out some way around to assign one or multiple categories to solution at the time of import. 

 

Ispita_NavatarIspita_Navatar

The following query shows all the fields which are there in a CaseSolution object:-

Select c.SystemModstamp, c.SolutionId, c.IsDeleted, c.Id, c.CreatedDate, c.CreatedById, c.CaseId From CaseSolution c

This object has "CategoryData" as a child object among many others. THe following is the SOQL query showing all the fields available, besides the access level as shown in ecllipse is creatable, deletable, queryable, replicateable,updateable- hence is has all  rights of access.

 

Select c.SystemModstamp, c.RelatedSobjectId, c.LastModifiedDate, c.LastModifiedById, c.IsDeleted, c.Id, c.CreatedDate, c.CreatedById, c.CategoryNodeId From CategoryData c

 

CategoryNode is where categories are defined , enclose is the basic select query:-

 

Select c.SystemModstamp, c.SortStyle, c.SortOrder, c.ParentId, c.MasterLabel, c.LastModifiedDate, c.LastModifiedById, c.Id, c.CreatedDate, c.CreatedById From CategoryNode c

 

CategoryDate is the connector object between Solution and Category Node, so in order to assign Category to a Solution You have to insert CatagoryData record with RelatedSobjectId set to the Id of solution and also association with CategoryNode to has to be specified via CategoryNodeId.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.

 

 

RomyRomy

Thanks for reply...let me try this way...if I faced any problem I will post it here again...!!

 

 

RomyRomy

Thanks for ur reply...the two queries you mentioned gives me the  -- Category Data Id, and Category Node Id / Node Name --

 

CategoryNode[] cn = [Select c.SystemModstamp, c.SortStyle, c.SortOrder, c.ParentId, c.MasterLabel, c.LastModifiedDate, c.LastModifiedById, c.Id, c.CreatedDate, c.CreatedById From CategoryNode c];

 

CategoryData [] cd = [Select c.SystemModstamp, c.RelatedSobjectId, c.LastModifiedDate, c.LastModifiedById, c.IsDeleted, c.Id, c.CreatedDate, c.CreatedById, c.CategoryNodeId From CategoryData c];

 

My problem is how to assign a category / Subcategory automatically to Solution when it is created / uploaded (on the basis of some custom field value -- say a pick list --> If picklist value == value 1 => Assign Category 1; If picklist value == value 2 => Assign Category 2).

 

If I use the Insert trigger on Solution, I don't think I can write the Insert DML statement like -- Insert Category Node   because I am not Inserting a new node. I have to actually assign a category node to Solution so that it will appear  under Solution Categories  related list on solution detail page. For this I need to update some field on the Solutio that is related to Category / Category Node. But I can't find any such field on solution that specify the category assigned to solution. Fields available under solution are listed in the query below:

 

Select s.TimesUsed, s.SystemModstamp, s.Status, s.SolutionNumber, s.SolutionNote, s.SolutionName, s.OwnerId, s.Legacy_Source__c, s.LegacyId__c, s.LastModifiedDate, s.LastModifiedById, s.IsReviewed, s.IsPublishedInPublicKb, s.IsPublished, s.IsHtml, s.IsDeleted, s.Id, s.CurrencyIsoCode, s.CreatedDate, s.CreatedById From Solution s

 

I will appreciate If some can suggest me how to proceed here?

Mahesh_BMahesh_B

I'm also seeing the same issue.  Is there any way to get the Categories which is been selected for the Solution.

 

-Mahesh