Comments (4)
I think the readme needs to be updated. Does it work if you cast the FeedElement to be a FeedItem? For example:
ConnectApi.FeedItem fi = (ConnectApi.FeedItem) ConnectApiHelper.postFeedItemWithMentions(Network.getNetworkId(), 'me', 'Hey there {005D00000015tjz}, how are you?');
from connectapihelper.
That worked.
How can I set the RelatedRecordId for the same post? I need to associate
the post to a WorkThanks record. Easy enough to do normally. Just not sure
how to do with this helper method.
On Mon, Mar 28, 2016 at 10:44 AM, alouie-sfdc [email protected]
wrote:
I think the readme needs to be updated. Does it work if you cast the
FeedElement to be a FeedItem? For example:ConnectApi.FeedItem fi = (ConnectApi.FeedItem) ConnectApiHelper.postFeedItemWithMentions(Network.getNetworkId(), 'me', 'Hey there {005D00000015tjz}, how are you?');
—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#5 (comment)
from connectapihelper.
Not sure about that. Work Thanks posts aren't supported in the ConnectApi family of methods, so you'll need to use the FeedItem sObject. Maybe you can do it like this after the above call to ConnectApiHelper.postFeedItemWithMentions()
?
FeedItem f = new FeedItem(id = fi.id);
f.RelatedRecordId = 'your_record_id';
update f;
from connectapihelper.
That didn't work. However it got me thinking. How about I create my post as
normal and then have the helper method update it with the @mentions. I see
in the helper towards the bottom there are some other methods but i don't
know how to use them. Can someone help me out?
This is how I create the FeedItem with the associated Work Thanks record.
//Post to Chatter
FeedItem F = new FeedItem(
Body = msg2,
CreatedById = cUser.Id,
ParentId = cGroup.Id,
RelatedRecordId = t.Id,
Type = 'RypplePost'
);
try {
insert F;
} catch(DmlException e) {
System.debug('The following exception has occurred: '
-
e.getMessage());
}//Update Record with @Mention //Here is where the connectapi should be called but don't
know how to do it.
On Mon, Mar 28, 2016 at 1:06 PM, alouie-sfdc [email protected]
wrote:
Not sure about that. Work Thanks posts aren't supported in the ConnectApi
family of methods, so you'll need to use the FeedItem sObject. Maybe you
can do it like this after the above call to
ConnectApiHelper.postFeedItemWithMentions()?FeedItem f = new FeedItem(id = fi.id);
f.RelatedRecordId = 'your_record_id';
update f;—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#5 (comment)
from connectapihelper.
Related Issues (16)
- Error: Compile Error: Method was removed after version 35.0: postFeedElement at line 109 column 40 HOT 1
- When we Call ConnectAPIHelper class through Batch Job throwing an exception as it is taking more than 150 DML Statements HOT 2
- Is there a way to support code snippet? HOT 2
- Please update this file for Spring 19 Hyperlink change. HOT 3
- Does ConnectApiHelper work with the ConnectApi.EntityLinkSegmentInput subclass? HOT 2
- Make ConnectApiHelper easier to use with Salesforce DX
- FYI - Using ConnectApiHelper in a new Flow Process Action
- Make the class bulk-friendly HOT 1
- Add support for feed item visibility HOT 1
- Remove dependency to SeeAllData
- ConnectApiHelperTest: "Context user does not have permission to create rich text in feed" HOT 1
- getMessageSegmentInputs not working with "<p style="text-align: center;">Hello</p>"
- EntityLink segment not allowed. Contact your administrator to enable it.
- Change in postFeedElement v36 HOT 3
- Use Variable on the Post HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from connectapihelper.