Questions tagged [connect-api]

ConnectApi is the Apex namespace that includes Chatter in Apex functionality.

Filter by
Sorted by
Tagged with
11
votes
2answers
14k views

How can I create a Chatter File via Apex?

From the Chatter tab I can go to 'Files' and then upload a file without attaching it to anything. I am wanting to know if there is a way to achieve the exact same thing via Apex?
15
votes
4answers
8k views

How can I add an @mention when creating a FeedItem via APEX?

I have found that this can be done via the Chatter API, and that there is a pilot program (http://developer.force.com/cookbook/recipe/connect-in-apex-pilot) to bring this to APEX, but I am not ...
5
votes
1answer
2k views

Retrieve UserId of @mention user from chatter post in Apex

Is there a way to retrieve the user id of @mention user from chatter post in Apex? We can write a before insert trigger on feeditem, but when we display the body (which has @mention user) it simply ...
3
votes
1answer
492 views

Can Chatter Connect API set createdByUser to other than logged in user?

I know this question has been asked earlier but I could not find the answer. I am trying to create chatter Feed using Chatter connect API and my need is "Createdby user should be different than ...
4
votes
2answers
3k views

How do I write tests for custom classes that primarily use ConnectApi?

I have implemented a VF page that displays a Chatter Group feed using the example classes provided in the Salesforce Cookbook. I have implemented all of these classes (with some tweaks and added ...
3
votes
2answers
2k views

Record chatter post with link

Using ConnectApi Reference: http://www.salesforce.com/us/developer/docs/apexcode/Content/connectAPI_outputs.htm#capi_entityLinkSeg_output I want to create from apex code a chatter post on a record, ...
3
votes
0answers
363 views

References to URLs returned by Apex ConnectApi in Salesforce1 mobile

I have a VF page that I am using as an inline page on the Opportunity detail page layout. It retrieves and displays files (FeedItems with ConnectApi.ContentCapability) from Chatter feeds on records ...
2
votes
2answers
4k views

Creating a FeedItem Using Connect in APEX

My goal is to create a trigger/class that, when a Financial Account (custom object) has it's balance change by more than 20% in either direction, creates a chatter post informing users of the 'Big ...
9
votes
2answers
650 views

Does 'Chatter in Apex' aka Chatter Connect API support Bulkified insert operations?

I want to add Chatter feeds from Trigger and obviously I am going to implement this as Bulkified. I have data in the following format. Public Class ChatterFeedInfo { public Id usermentionId {get;...
7
votes
1answer
326 views

What Controls the URL Format for Chatter Content?

When I query the chatter connect API through Javascript from a Visualforce page in a desktop browser, the post attachment URLs I receive use the visualforce domain that the page is being served up ...
6
votes
2answers
3k views

why need seeAllData = true in test class when use connectAPI

In my controller i'm using connectApi and my class functionality is working fine but the issue is when i'm using in my Test class (SeeAllData=true) it's covered 100% but seeAllData = true is not ...
4
votes
1answer
4k views

Error: The Connect API is not enabled for this user type

I am working on creating a Force.com site and I have a VF page which displays fields from a custom object record and also displays its Chatter feed. I achieved displaying the Chatter feed using the ...
3
votes
2answers
6k views

How to dynamically creating chatter groups in Apex?

It looks like ConnectApi.ChatterGroup is abstract. Is there really no way to create Chatter groups via connect in Apex? Is the solution to call the chatter REST API from APEX? UPDATED based on ...
2
votes
1answer
1k views

Unable to send myself a test Chatter Message

I am trying to send myself a test Chatter message as the first step towards a proof of concept. The desired outcome is that I will get a private chat message pop up in the bottom right-hand corner of ...
2
votes
1answer
1k views

NoAccessException on ConnectApi.ChatterFeeds.updateFeedElement : line 706 column 1

Urgent Help Needed: I am getting exception while updating a chatter feed using ConnectApi.ChatterFeeds class. I am not getting it regularly but for some specific users under a particular custom ...
1
vote
1answer
819 views

ConnectApi.ChatterFeeds Limit handling in trigger

I want my code to be reviewed and please point me the scenarios where it can cause exception. I have a trigger which modifies the chatter feed on Position__c object, trigger FeedItemBodyModify on ...
1
vote
2answers
1k views

How do I test that a ConnectApi.AnnouncementInput has been posted to a CollaborationGroup?

I have a trigger that posts a ConnectApi.AnnouncementInput, but how do I test that this has been posted, and to the correct chattergroup? I've created the test collaborationgroup in my test method, ...
1
vote
1answer
828 views

Create a Custom Chatter Stream from Apex ConnectApi

I love Chatter streams and how they allow me to combine and filter existing feeds. I would like to create such stream dynamically in Apex and found a ChatterFeeds.createStream(communityId, streamInput)...