You need to sign in to do that
Don't have an account?
Hardy Vardès Tsialoungou Nkouka
Get SObject permissions and Name profil
Hi !
I want to get for each SObjet the Profil Name, PermissionRead, PermissionWrite, PermissionEdit via Apex.
I tried this :
SELECT O.SobjectType, O.PermissionsRead, PermissionWrite, PermissionEdit, P.ProfileId, P.Profile.Name
FROM ObjectPermissions O, PermissionSet P
WHERE ( P.Id = O.ParentId) AND (O.SobjectType = 'Account')
But it does'nt work !
Can anyone help me?
Thanks
Hardy
I want to get for each SObjet the Profil Name, PermissionRead, PermissionWrite, PermissionEdit via Apex.
I tried this :
SELECT O.SobjectType, O.PermissionsRead, PermissionWrite, PermissionEdit, P.ProfileId, P.Profile.Name
FROM ObjectPermissions O, PermissionSet P
WHERE ( P.Id = O.ParentId) AND (O.SobjectType = 'Account')
But it does'nt work !
Can anyone help me?
Thanks
Hardy
I'm not sure why you see the [object Object] values. When I perform that query in SOQLXplorer, I get the following result:
If you perform the query in Apex and show the results on screen, I get the following output:
I created the overview by creating 1 vf page and 1 apex controller:
VF Page:
Apex controller (ObjectPermissionsOverviewController):
Hope this helps!
Best regards,
Martijn Schwärzer
Ps. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.
All Answers
Please try:
Hope this helps!
Best regards,
Martijn Schwärzer
Ps. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.
Thank you for your reply. Pease, look at the result of this request:
Could you tell me how to get real names of Profil.name?
Thanks,
Hardy
I'm not sure why you see the [object Object] values. When I perform that query in SOQLXplorer, I get the following result:
If you perform the query in Apex and show the results on screen, I get the following output:
I created the overview by creating 1 vf page and 1 apex controller:
VF Page:
Apex controller (ObjectPermissionsOverviewController):
Hope this helps!
Best regards,
Martijn Schwärzer
Ps. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.
That works !!
Very helpfull