2

I have a permission set named abc.

Permission to Asset Level field for Asset object is defined like below in abc:

enter image description here

I am trying to get field level permissions for abc permission set using the below query:

SELECT Name,
            (
                SELECT
                    SObjectType,
                    Field,
                    PermissionsRead,
                    PermissionsEdit
                FROM FieldPerms
                WHERE SObjectType='Asset'
            )
        FROM PermissionSet WHERE Name='abc'

But in the results, I am not able to get Asset Level and some other field permissions.

I tried fetching the permission set using ANT but not able to get permission for the above field there too.

What I am missing here?

3
  • Consider using the SFDX CLI with a command like sfdx force:source:retrieve -m PermissionSet and see if you can see the metadata permissions there – Brian Miller Dec 16 '19 at 8:49
  • 1
    Are you executing the SOQL as an admin and in which API version ? I've created a permission set abc in a dev org, tried SOQL under API 47 and got result for Asset level field permission. SOQL result shows field as Asset.AssetLevel – Shamina Dec 16 '19 at 10:55
  • @Shamina Thanks. I logged in with my System Administrator account and able to see this field. But facing similar kind of situation with CurrencyIsoCode in Account – वरुण Dec 16 '19 at 12:07
3

Just to recap: Ensure that the user executing the SOQL has relevant permission on the object and fields you are trying to query from FieldPermissions.

Regarding your question about CurrencyIsoCode:

As per chapter "Special Properties for Field Permissions" in documentation here, fields that are always readable and/or writable, don’t return a FieldPermissions record.

Although CurrencyIsoCode field is not explicitly mentioned in the documentation, if multiple currencies is enabled in the org, CurrencyIsoCode becomes a universally required field and hence always readable irrespective of the profile or permission set. This is why this field is not returned when querying on FieldPermissions.

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.