Salesforce admin Notes
这里记录一些管理员常用SQL。
Permission
Object: SetupEntityAccess
ParentId | SetupEntityId |
---|---|
Permission_id | class_id |
class_id or page_id
Group Member
后台把用户大量加入group里面的方法如下,object name: GroupMember
UserOrGroupId | GroupId |
---|---|
USER_ID | Group_Id |
注意这里Group_Id可以为queue。
Sharing
查询某一数据的 Sharing 的快速链接
https://yourcompany.salesforce.com/p/share/CustomObjectSharingDetail?parentId={your_recordId}
注意,如果是account,https://yourcompany.salesforce.com/p/share/AccSharingDetail?parentId={your_recordId}
直接打开某一对象的Sharing rule的设置页面,可以直接用如下链接:
如何检查数据的Access Right?
1 | SELECT RecordId,HasReadAccess FROM UserRecordAccess WHERE UserId = :userInfo.getUserId() AND RecordId = 'abc' |
重置密码apex code
1 | system.setPassword('<user_id>','your_password'); |
查询 Class 的Permission
Check Class Permission SQL :
1 | select id,(SELECT Id, Parent.Name, Parent.Profile.Name FROM SetupEntityAccessItems) from ApexClass where name = 'YourclassName' |