chatter_code
上述网址中创建最新活动FeedItem是在recipe6
//Adding a Text post 插入文本 FeedItem post = new FeedItem(); post.ParentId = oId; //eg. Opportunity id, custom object id.. post.Body = 'Enter post text here'; insert post; //Adding a Link post 插入链接 FeedItem post = new FeedItem(); post.ParentId = oId; //eg. Opportunity id, custom object id.. post.Body = 'Enter post text here'; post.LinkUrl = 'http://www.someurl.com'; insert post; //Adding a Content post 插入文件(上传附件) FeedItem post = new FeedItem(); post.ParentId = oId; //eg. Opportunity id, custom object id.. post.Body = 'Enter post text here'; post.ContentData = base64EncodedFileData(注意类型-流); post.ContentFileName = 'sample.pdf'; insert post;
FeeItem Api
介绍了FeedItem相关属性
The type of FeedItem:
ActivityEvent—generated event when a user or the API adds a Task associated with a feed-enabled parent record (excluding email tasks on cases) or when a user or the API adds or updates a Task or Event associated with a case record (excluding email and call logging).
For a recurring Task with CaseFeed disabled, one event is generated for the series only. For a recurring Task with CaseFeed enabled, events are generated for the series and each occurrence.
查找FeedItem 主键Id
List<FeedItem> flist = [SELECT ID,Title,Body, LinkUrl from FeedItem];
我搜索自己的feedItem内容,共搜索到六条
flist = (
FeedItem:{Body=null, Id=0D59000000IjFsxCAF},
FeedItem:{Body=4廷44, Id=0D59000000IjwxXCAR},
FeedItem:{Body=null, Id=0D59000000Ik0C6CAJ},
FeedItem:{Body=466666, Id=0D59000000JAQlyCAH},
FeedItem:{Body=Enter post text here, Id=0D59000000JCxK1CAL},
FeedItem:{Body=Enter post text here, Id=0D59000000JCxhtCAD, LinkUrl=http://www.someurl.com, Title=www.someurl.com}
)
FeedComment fcomment = new FeedComment(); fcomment.FeedItemId = fId; //Id of the FeedItem on which you want to comment fcomment.CommentBody = 'Enter your comment here'; insert fcomment;
http://www.salesforce.com/us/developer/docs/api/index_Left.htm#CSHID=sforce_api_objects_feeditem.htm|StartTopic=Content%2Fsforce_api_objects_feeditem.htm|SkinName=webhelp