salesforce chatter 调查的相关内容

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类型还有很多

FeeItem Api

介绍了FeedItem相关属性 

The type of FeedItem:

  • TrackedChange—a change or group of changes to a tracked field
  • UserStatus—automatically generated when a user adds a post
  • TextPost—a direct text entry on a feed
  • LinkPost—a URL posting on a feed
  • ContentPost—an uploaded file on a feed
  • PollPost—a poll posted on a feed
  • DashboardComponentSnapshot—a posting of a dashboard snapshot on a feed.
  • ApprovalPost—automatically generated by a feed query on an approval item
  • CollaborationGroupCreated—automatically generated post on a user’s feed when the user creates a public group
  • 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.

The following values appear in the   Type  picklist for all feed objects but apply only to   CaseFeed:
  • CaseCommentPost—generated event when a user adds a case comment for a case object
  • EmailMessageEvent—generated event when an email related to a case object is sent or received
  • CallLogPost—generated event when a user logs a call for a case through the user interface. This event is also generated by CTI calls.
  • ChangeStatusPost—generated event when a user changes the status of a case
  • AttachArticleEvent—generated event when a user attaches an article to a case


查找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}

)



为FeedItem添加评论

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




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值