Saturday, March 12, 2016

Idea object and relationship between its Zone and Record type:

Idea object in Salesforce is one of the most powerful object when it comes to collaboration and if we need employee/customers feedback for any new strategies & Implementations. For Idea implementation, please go through this guide:


Although this guide describe it nicely to setup the idea in org but it could be confusing and time consuming if we want any information at API level for any custom development. We did this in one of the project so wanted to list down all of the objects at API level which were involved in it.

Idea: It stores the body, file attachment, status, category and Zone and related Votes. 

IdeaComment: it stores all the information related to comments on any Idea record. 

Zone: This is a way to logically separate the Idea implementation in any org. Based on Zone we can decide the different values of Categories and Status fields. Often also referred as community. 

 VoteThis represents the user endorsements for idea and its comments. Now it could be +ve or -ve which could be identified by Type field of it. Same object is used to endorse Idea/Idea comment etc. So to get the specific type of votes we can use parent.type filter in query. E.g {{Parent.Type = 'IdeaComment'}}

 IdeaTheme: This is to collect the idea for any topic among the community members or employees. All the ideas which are submitted under any theme will be a child of it and associated via {{IdeaThemeID}} field of idea object. 

Zone and Record type:

Although both are different as they belongs to different object itself but somehow they are related to each other. The hint which tells us that they are related is, setting the idea picklist values based on Zone setup. However, for any other (or most of the) objects in Salesforce, it could be done only for record types. If we query any Idea record and see its recordTypeId, its certainly not same as its communityId(ZoneId).

We worked on a requirement, where we were supposed to show the list of idea on VF and they could be filtered based on Zone, Categories and Status picklist. Now there is no direct way to get the dependent options of picklist based on Zone selection.

Here comes the metadata API handy and allow us to describe the layout and get the results what we need. This is the working example of VF which gives the results in console. As shown in console image, within record type mapping the name what we are getting is Zone Name. So finally we had created an array of objects {{FinalResult}} which had the name as Zone name and all other picklist values as other nodes.



P.S. In this example it has been shown to get the Idea picklist values based on record type, although this could be used in general for any object when we build some custom application where can't be used. 

No comments:

Post a Comment