需求: 当我们想把一个Object里面的,所有的自定义字段都给取出来
我们可以用下面的SOQL语句来取得(需要勾选上Use Tooling API?选项)
TableEnumOrId 的值就是这个Object的Id
在Classic界面下面,Object的自定义页面的地址如下。标粗体的就是Object的ID
在Lightning界面下面的地址如下,标粗体的就是Object的ID
SELECT DeveloperName, TableEnumOrId FROM CustomField WHERE TableEnumOrId = '01I5h0000006Q5e'
取得的结果如下
"_","DeveloperName","TableEnumOrId"
"[CustomField]","Memo","01I5h0000006Q5eEAE"
"[CustomField]","Certification","01I5h0000006Q5eEAE"
"[CustomField]","CloseDate","01I5h0000006Q5eEAE"
"[CustomField]","Year","01I5h0000006Q5eEAE"
"[CustomField]","Month","01I5h0000006Q5eEAE"
"[CustomField]","SalesTargetAmount_Direct","01I5h0000006Q5eEAE"
"[CustomField]","SalesByYear_BD_parent","01I5h0000006Q5eEAE"
"[CustomField]","MyEmail","01I5h0000006Q5eEAE"
关于CustomField Object,详细可以参考下面的链接