查询salesforce中的attachments应该使用ContentDocumentLink对象

之前是attachments对象,不过目前已经是ContentDocumentLink。

SELECT ContentDocumentId,Id,LinkedEntityId,ShareType FROM ContentDocumentLink WHERE LinkedEntityId = 'YourRecordId'

SELECT ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = '[RECORD ID]'
Then SOQL on ContentDocument

Select Id ,Title from ContentDocument Where ID In :[CONTENTDOCUMENTLIST]

参考链接:https://salesforce.stackexchange.com/questions/118340/querying-attachments-in-apex-class

你可能感兴趣的:(Salesforce,数据库,sql,salesforce)