怎么取得所有ListView的创建者,创建时间,名称和DeveloperName(使用SOQL实现)
2023年09月13日
文章浏览:304
需求: 有时候,我们需要把所有ListView的创建者,创建时间,名称和DeveloperName给取出来



取得单独一个Object的ListView信息

SELECT 
Id, 
Name, 
DeveloperName, 
NamespacePrefix, 
SobjectType, 
IsSoqlCompatible, 
CreatedDate, 
CreatedBy.Name, 
LastModifiedDate, LastModifiedBy.Name, LastViewedDate, LastReferencedDate 
FROM ListView
where 
SobjectType ='Lead'


取得的结果如下

"_","Id","Name","DeveloperName","NamespacePrefix","SobjectType","IsSoqlCompatible","CreatedDate","CreatedBy","CreatedBy.Name","LastModifiedDate","LastModifiedBy","LastModifiedBy.Name","LastViewedDate","LastReferencedDate"
"[ListView]","00B5h00000GAWN4EAP","All Open Leads","AllOpenLeads","","Lead","true","2021-12-27T23:21:45.000+0000","[User]","兪 思忠","2021-12-27T23:21:45.000+0000","[User]","兪 思忠","2023-09-08T15:07:23.000+0000","2023-09-08T15:07:23.000+0000"
"[ListView]","00B5h00000GAWPVEA5","My Unread Leads","MyUnreadLeads","","Lead","true","2021-12-27T23:21:45.000+0000","[User]","兪 思忠","2021-12-27T23:21:45.000+0000","[User]","兪 思忠","2023-09-08T15:07:23.000+0000","2023-09-08T15:07:23.000+0000"
"[ListView]","00B5h00000GAWPjEAP","Today's Leads","TodaysLeads","","Lead","true","2021-12-27T23:21:45.000+0000","[User]","兪 思忠","2021-12-27T23:21:45.000+0000","[User]","兪 思忠","2023-09-13T13:56:22.000+0000","2023-09-13T13:56:22.000+0000"
"[ListView]","00B5h00000GAWPuEAP","View - Custom 2","ViewCustom2","","Lead","true","2021-12-27T23:21:45.000+0000","[User]","兪 思忠","2021-12-27T23:21:45.000+0000","[User]","兪 思忠","2023-09-08T15:07:23.000+0000","2023-09-08T15:07:23.000+0000"
"[ListView]","00B5h00000GAWPvEAP","View - Custom 1","ViewCustom1","","Lead","true","2021-12-27T23:21:45.000+0000","[User]","兪 思忠","2021-12-27T23:21:45.000+0000","[User]","兪 思忠","2023-09-08T15:07:23.000+0000","2023-09-08T15:07:23.000+0000"
"[ListView]","00B5h00000GAWQGEA5","Recently Viewed Leads","RecentlyViewedLeads","","Lead","true","2021-12-27T23:21:45.000+0000","[User]","兪 思忠","2021-12-27T23:21:45.000+0000","[User]","兪 思忠","2023-09-05T15:32:48.000+0000","2023-09-05T15:32:48.000+0000"



关于ListView,详细可以参考下面的链接

 https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_listview.htm 


关注 收藏