2

Will I get flagged in the security review if I return a list of fields on the Contact object (or Account, Contact, Opporunity) to the user by doing this?

schemaMap.get('Contact').getDescribe().fields.getMap(); 

1 Answer 1

2

No. In fact, you need to use describes to properly enforce FLS, because it's the only way to find out if a field is accessible.

A couple examples:

Boolean isContactNameAccessible = SObjectType.Contact.fields.Name.isAccessible();
Boolean isAccountNameAccessible = Account.getDescribe().fields.getMap().get('Name')
    .getDescribe().isAccessible();

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .