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
SexmanSexman 

How to get the Community Name of an Idea in Apex?

"Ideas" is standard object wich has communities. Each idea belongs to one community. I wan't to know how to get the name of that community from the controller of my page.

 

Thanks :)

Best Answer chosen by Admin (Salesforce Developers) 
Pradeep_NavatarPradeep_Navatar

You can use SOQL Query in your controller code. Tryout the code given below :

 

Idea ida = [Select i.Community.Name, i.CommunityId From Idea i where id="idead id"];

 

Hope this helps.

All Answers

Pradeep_NavatarPradeep_Navatar

You can use SOQL Query in your controller code. Tryout the code given below :

 

Idea ida = [Select i.Community.Name, i.CommunityId From Idea i where id="idead id"];

 

Hope this helps.

This was selected as the best answer
SexmanSexman

Thanks!! It works =D