LoginSignup
1
0

調べものをする時に便利なSOQLを集めてみる

Last updated at Posted at 2022-03-01

一度に確認する方法がなさそうなかんじですね。
SOQLで検索するにしても、UserRecordAccessを検索してアクセス権を確認する方法みたいです。

Apexで繰り返しのコードを書けばよさそうですが、単純にSOQLをコールすると101回の制限にかかりそうです。

英語ですが回答されています。
https://developer.salesforce.com/forums/?id=9062I000000IRq3QAG

カスタムメタデータ

SELECT Label,QualifiedApiName from EntityDefinition Where QualifiedApiName LIKE '%__mdt%'

権限セットのある項目がtrueになっているものを探す

参照のみ項目の編集はPermissionsEditReadOnlyFields

SELECT Name,PermissionsEditReadOnlyFields FROM PermissionSet where PermissionsEditReadOnlyFields = true
日本語ラベル API名
すべてのデータの編集 PermissionsModifyAllData
参照のみ項目の編集 PermissionsEditReadOnlyFields

英語で項目名を確認してブランクを省くとAPI名と一致するようです。

子オブジェクト一覧の確認方法について

SOQLを使っても問題ないのであれば、以下の方法があるようです。
サンプルはAccountオブジェクトが親の子オブジェクトを探しています。

For getting All Child objects:

Schema.DescribeSObjectResult R = Account.SObjectType.getDescribe();
for (Schema.ChildRelationship cr: R.getChildRelationships()) {
   system.debug(====child object===+cr.getChildSObject());
}

https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007T42bJSAR

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0