+ Start a Discussion
Leslie StaceyLeslie Stacey 

Triggering Thanks badge (is this a feeditem?)

Hi,

 

We would like to trigger a "Thanks Badge" everytime a record is created that meets a specific criteria (i.e score = 10 out of 10).

 

Any idea what the Feeditem is within Apex ? How do I specify the badge?

 

appreciate everyones insight.

 

Kind regards,

 

Leslie

Best Answer chosen by Admin (Salesforce Developers) 
Leslie StaceyLeslie Stacey

Ok, it's solved.

 

FeedItem post = new FeedItem();

post.ParentId='005w00000036KTMAA2'; //userId

post.Type='RypplePost'; //constant

post.Body='This is my successful test'; //any text

post.RelatedRecordId='0W0w0000000CaaaCAC'; //this controls picture

//post.CreatedById,

//post.ContentData='/services/data/v29.0/sobjects/FeedItem/0D5w0000013qopICAQ/ContentData';

//post.InsertedById='00520000002nmehAAA';

insert post;

 

Thanks to my internal team and a bit of delving through the documentation.

 

 

All Answers

Leslie StaceyLeslie Stacey

Ok, it's solved.

 

FeedItem post = new FeedItem();

post.ParentId='005w00000036KTMAA2'; //userId

post.Type='RypplePost'; //constant

post.Body='This is my successful test'; //any text

post.RelatedRecordId='0W0w0000000CaaaCAC'; //this controls picture

//post.CreatedById,

//post.ContentData='/services/data/v29.0/sobjects/FeedItem/0D5w0000013qopICAQ/ContentData';

//post.InsertedById='00520000002nmehAAA';

insert post;

 

Thanks to my internal team and a bit of delving through the documentation.

 

 

This was selected as the best answer
alouie_sfdcalouie_sfdc
Just out of curiosity, where in the documentation is this mentioned? I looked on http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_feeditem.htm and couldn't see any references to the RypplePost type or the use of the RelatedRecordId field for this purprose.
Leslie StaceyLeslie Stacey

Try these 2 documents :

in the "ConnectApi.FeedItemType" section @ http://www.salesforce.com/us/developer/docs/apexcode/Content/connectAPI_enums.htm

 

Page 304 on http://www.salesforce.com/us/developer/docs/chatterapi/salesforce_chatter_rest_api.pdf

 

We are just trying to implement that @mention tag within the Post to ensure that the email is generated to the end user.

 

Rebecca YorkRebecca York
Hi Leslie,

Can you tell me what's meant to go in here: post.RelatedRecordId='0W0w0000000CaaaCAC'; //this controls picture ?

I assumed it was the ID of the badge I wanted, but it's coming up with an error for me.

Thanks.