86. Do you have a SQL script to check the permissions for all the fields belonging to a particular object?

Please use the following code snippet in the workbench to check whether any object and its fields have all the relevant permissions.

Workbench link: https://workbench.developerforce.com/login.php

DescribeSObjectResult result = Schema.getGlobalDescribe().get(‘‘).getDescribe();
System.debug(‘Object Accessible:’+result.isAccessible());
System.debug(‘Object Createable:’+result.isCreateable());
System.debug(‘Object Updateable:’+result.isUpdateable());
System.debug(‘Object Deleteable:’+result.isDeletable());
for (Schema.Sobjectfield obj : result.fields.getMap().values()) {
Schema.DescribeFieldResult fldResult = obj.getDescribe(); System.debug(‘Field Name:’+fldResult.getLabel()+’;\tField Accessible:’+fldResult.isAccessible()+’;\tField Createable:’+fldResult.isCreateable()+’;\tField Updateable:’+fldResult.isUpdateable()); }
xTo test this chatbot, please submit your details on this page
Note: After submitting your details you will be redirected to this page and access chatbot