You need to sign in to do that
Don't have an account?
SunnySun
Get field type / permissions in the apex code
hi, All
I have a trouble. then i want to get formula type field .And I want to know the field for the current user's permissions.
Map<String, Schema.SobjectField> fields = Schema.SobjectType.OpportunityLineItem.fields.getMap();
I can use this find field properties.But I did not find a way to judge whether the formula type field.And I want to know the field for the current user's permissions too. Used to remove the current user without permissions field.
Any help will be Appreciated.
To determine if the current user's permissions allow them access to that field, you can use the 'isAccessible' method. The isAccessible method returns true if the current user can see this field, false otherwise. The isUpdateable method will return true if the field can be edited by the current user, false
otherwise.
Also,
you can tell if the field is a formula field by using the 'isCalculated' method, which returns true if the field is a custom formula field, false otherwise.
i.e.:
I hope that helps.
check out this link for more information: Describe Field Result Methods