You need to sign in to do that
Don't have an account?
Murali0089
Community Id
Hi everyone
Please help me how to acheive the community Id in apex urgent,,,
Thanks in advance
Regards,
Murali
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Hi everyone
Please help me how to acheive the community Id in apex urgent,,,
Thanks in advance
Regards,
Murali
Hi Murali,
You can use the ID field in Community table to get the Community ID: e.g.
FATAL_ERROR|ConnectApi.ConnectApiException: Illegal value for parameter: 'communityId': 09aU0000000PC1cIAG
How to correctly retreive the community ID?
Thanks
Hi Sandra,
You can use SOQL to retrieve the communityID , sample code:
Thanks but I have already tried that and it is not working
Actually I am trying to implement a custom chatter feed for a community
I m using the code of the quick start : http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_connectapi_quickstart.htm
but in order to display the feed related to the community I created (not the internal community), I shoud pass the community Id to the ConnectApi class
but I keep having the error saying the Id is not valid as a comunityId for the call : ConnectApi.ChatterUsers.getGroups(..)
Know its a slightest possibility but could you confirm that the ID you are passing is within quotes as Id is a string - also could you paste your code here so i have a better idea..
Here is the code. By the way, after enabling and creating a first community, the table Community contained only one record, which is 'internal community', after enabling Ideas for the community, and specifying a zone, there was a new record created in the Community Table having the name 'Ideas for community'
So I wonder if it is really the Community Id or an Idea Zone ID...
When debugging the code bellow, I keep having the error :
I found the correct Community ID...
I log debugged the following line
System.debug('#####' + ConnectApi.Communities.getCommunities());
So I had the list of communities the running user has access to.
The ID looks like '0DBU00000004CBdOAM'
It is not mentioned in any Community documentation how to retreive this ID! I looked in all the Salesforce guides!
Thanks anyway
I am also trying to create custom chatter feed for community. Could you please help me with it?
ConnectApi.Communities.getCommunities() this will give all the communities related data ...what if i have multiple commuties but i need to pick it only particular community that i have logged in ...this should happen dynamic ..and also is there a way to find community name dynamically that will also work for me so that based on that name i will query that ID ....can anyone help on this
import COMMUNITY_ID from '@salesforce/community/Id';
Hi Murali,
you can use this soql in your Apex code for fetching community Id, hope this will work.
SELECT Id, Name, UrlPathPrefix FROM Network WHERE UrlPathPrefix != null
Please mark it as the best answer if it will help you.
Thanks