學習目標
1,通過soql找到包含附件的數據
soql找到包含附件的數據
//給出的例子是找出商機下包含附件的數據
List<String> parentIdList = new List<String>();
for(Attachment att:[select id, ParentId from Attachment where ParentId IN (SELECT Id FROM Opportunity) limit 10]){
parentIdList.add(att.ParentId);
}
System.debug(JSON.serialize(parentIdList));
記錄一下,一起學習,一起進步!