1

Using this query to obtain permission on profile but getting [object Object] for the Parent.Profile.Name. Seen other post but still not able to show the name. Running from dev console if that still makes a difference ?

SELECT Id, SobjectType, Parent.label, Parent.Profile.Name,
PermissionsCreate, PermissionsRead, PermissionsEdit, PermissionsDelete,
PermissionsViewAllRecords, PermissionsModifyAllRecords
FROM ObjectPermissions 
WHERE parentid in (select id from permissionset where
PermissionSet.Profile.Name = 'MY PROFILE NAME')
  • 1
    Developer console doesn't show reference fields property, you may have to use work query in workbench or some other tool. – Raul Jun 23 at 20:54
  • 1
    Thanks. Thought this was the case. Will throw the query into a VisualForce page . Looks better anyway. – rickmac Jun 23 at 21:14
2

There's nothing wrong with your query, it's just as Raul mentioned. The problem comes from the fact that you are running it in the Developer Console.

I simplified your query just for this example to only query for Parent.Profile.Name and I put a LIMIT 1:

SELECT Parent.Profile.Name
FROM ObjectPermissions 
WHERE parentid in (select id from permissionset where
PermissionSet.Profile.Name = 'System Administrator')
LIMIT 1

Here's what I get when I run the query in Dev Console:

[1]: https://i.stack.imgur.com/mSRnp.png

If I run the same query using a different tool(in this case I am using organizer for Chrome):

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.