首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >simple_salesforce馈送项目@提问题

simple_salesforce馈送项目@提问题
EN

Stack Overflow用户
提问于 2022-07-26 06:50:24
回答 1查看 130关注 0票数 0

在过去的几天里,我一直试图提到一个使用简单的销售力量和闲聊的人,但都没有成功。我尝试过不同的方法,但都没有给我带来令人满意的结果。

这很好,而且我能够为特定的父母创建一个FeedItem,但是@mention呈现为文本。

代码语言:javascript
复制
record = pd.DataFrame({'ParentId':['parent_salesforce_id']
                      ,'Body':['{%salesforce_id} Test.']
                      ,'Type':['TextPost']})
record = record.to_dict(orient="records")
results = sf.bulk.feeditem.insert(record)
results

到目前为止,我已经尝试过:

  • {salesforce_id}
  • {%salesforce_id}
  • @FirstName LastName

在聊天API文档之后,我应该使用messageSegments来提及某个人,但是我的所有方法都失败了。

使用messageSegments的示例代码:

代码语言:javascript
复制
record = pd.DataFrame({'ParentId': 'parent_salesforce_id'
                      ,'Body': [[{'messageSegments': {'text' : 'Test'}}]]
                      ,'Type': 'TextPost'})
record = record.to_dict(orient="records")
results = sf.bulk.feeditem.insert(record)
results

Error message:
Out[14]: [{'success': False,
  'created': False,
  'id': None,
  'errors': [{'statusCode': 'INVALID_FIELD',
    'message': 'Unexpected JsonMappingException: Cannot deserialize instance of textarea from START_ARRAY value [ or request may be missing a required field\n at [Source: java.util.zip.GZIPInputStream@74f8b7a1; line: 1, column: 35]',
    'fields': []}]},
 {'success': False,
  'created': False,
  'id': None,
  'errors': [{'statusCode': 'INVALID_FIELD',
    'message': "Unexpected JsonMappingException: No such column 'messageSegments' on sobject of type FeedItem",
    'fields': []}]},
 {'success': False,
  'created': False,
  'id': None,
  'errors': [{'statusCode': 'INVALID_FIELD',
    'message': "Json Deserialization failed on token 'text' and has left off in the middle of parsing a row. Will go to end of row to begin parsing the next row",
    'fields': ['text']}]}]

我一直在使用与之前的堆栈帖子相同的方法。有人能帮我吗?提前谢谢你。

代码语言:javascript
复制
  [1]: https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/quickreference_post_feed_item.htm
  [2]: https://stackoverflow.com/questions/55165029/mentioning-chatter-request-sfdc-using-simple-salesforce-in-python
EN

回答 1

Stack Overflow用户

发布于 2022-07-26 07:50:04

我在一个流中解决了它,但它也应该在Apex代码中工作。试着用括号:

代码语言:javascript
复制
'@['+salesforce_id+']'
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73118866

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档