Code Monkey home page Code Monkey logo

Comments (4)

alouie-sfdc avatar alouie-sfdc commented on August 16, 2024 1

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.

mmetzinger avatar mmetzinger commented on August 16, 2024

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.

alouie-sfdc avatar alouie-sfdc commented on August 16, 2024

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.

mmetzinger avatar mmetzinger commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.