{"id":2325,"date":"2019-09-29T10:57:00","date_gmt":"2019-09-29T10:57:00","guid":{"rendered":"https:\/\/staging.txtbox.in\/docs\/salesforce\/?post_type=lsvr_faq&#038;p=2325"},"modified":"2019-09-29T10:57:00","modified_gmt":"2019-09-29T10:57:00","slug":"86-do-you-have-a-sql-script-to-check-the-permissions-for-all-the-fields-belonging-to-a-particular-object","status":"publish","type":"lsvr_faq","link":"https:\/\/staging.txtbox.in\/docs\/salesforce\/faq\/86-do-you-have-a-sql-script-to-check-the-permissions-for-all-the-fields-belonging-to-a-particular-object\/","title":{"rendered":"86. Do you have a SQL script to check the permissions for all the fields belonging to a particular object?"},"content":{"rendered":"\n<p>Please use the following code snippet in the workbench to check whether any object and its fields have all the relevant permissions.<\/p>\n\n\n\n<p>Workbench link:&nbsp;<a href=\"https:\/\/workbench.developerforce.com\/login.php\">https:\/\/workbench.developerforce.com\/login.php<\/a><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">DescribeSObjectResult result = Schema.getGlobalDescribe().get(\u2018\u2018).getDescribe();<br>System.debug(\u2018Object Accessible:\u2019+result.isAccessible());<br>System.debug(\u2018Object Createable:\u2019+result.isCreateable());<br>System.debug(\u2018Object Updateable:\u2019+result.isUpdateable());<br>System.debug(\u2018Object Deleteable:\u2019+result.isDeletable());<br>for (Schema.Sobjectfield obj : result.fields.getMap().values()) {<br>Schema.DescribeFieldResult fldResult = obj.getDescribe();&nbsp;System.debug(\u2018Field Name:\u2019+fldResult.getLabel()+\u2019;\\tField Accessible:\u2019+fldResult.isAccessible()+\u2019;\\tField Createable:\u2019+fldResult.isCreateable()+\u2019;\\tField Updateable:\u2019+fldResult.isUpdateable());&nbsp;}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Please use the following code snippet in the workbench to check whether any object and its fields have all the relevant permissions. Workbench link:&nbsp;https:\/\/workbench.developerforce.com\/login.php DescribeSObjectResult result = Schema.getGlobalDescribe().get(\u2018\u2018).getDescribe();System.debug(\u2018Object Accessible:\u2019+result.isAccessible());System.debug(\u2018Object Createable:\u2019+result.isCreateable());System.debug(\u2018Object Updateable:\u2019+result.isUpdateable());System.debug(\u2018Object Deleteable:\u2019+result.isDeletable());for (Schema.Sobjectfield obj : result.fields.getMap().values()) {Schema.DescribeFieldResult fldResult = obj.getDescribe();&nbsp;System.debug(\u2018Field Name:\u2019+fldResult.getLabel()+\u2019;\\tField Accessible:\u2019+fldResult.isAccessible()+\u2019;\\tField Createable:\u2019+fldResult.isCreateable()+\u2019;\\tField Updateable:\u2019+fldResult.isUpdateable());&nbsp;}<\/p>\n","protected":false},"author":5,"template":"","meta":{"footnotes":""},"lsvr_faq_cat":[320],"lsvr_faq_tag":[],"class_list":["post-2325","lsvr_faq","type-lsvr_faq","status-publish","hentry","lsvr_faq_cat-message-delivery"],"_links":{"self":[{"href":"https:\/\/staging.txtbox.in\/docs\/salesforce\/wp-json\/wp\/v2\/lsvr_faq\/2325","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staging.txtbox.in\/docs\/salesforce\/wp-json\/wp\/v2\/lsvr_faq"}],"about":[{"href":"https:\/\/staging.txtbox.in\/docs\/salesforce\/wp-json\/wp\/v2\/types\/lsvr_faq"}],"author":[{"embeddable":true,"href":"https:\/\/staging.txtbox.in\/docs\/salesforce\/wp-json\/wp\/v2\/users\/5"}],"version-history":[{"count":1,"href":"https:\/\/staging.txtbox.in\/docs\/salesforce\/wp-json\/wp\/v2\/lsvr_faq\/2325\/revisions"}],"predecessor-version":[{"id":2326,"href":"https:\/\/staging.txtbox.in\/docs\/salesforce\/wp-json\/wp\/v2\/lsvr_faq\/2325\/revisions\/2326"}],"wp:attachment":[{"href":"https:\/\/staging.txtbox.in\/docs\/salesforce\/wp-json\/wp\/v2\/media?parent=2325"}],"wp:term":[{"taxonomy":"lsvr_faq_cat","embeddable":true,"href":"https:\/\/staging.txtbox.in\/docs\/salesforce\/wp-json\/wp\/v2\/lsvr_faq_cat?post=2325"},{"taxonomy":"lsvr_faq_tag","embeddable":true,"href":"https:\/\/staging.txtbox.in\/docs\/salesforce\/wp-json\/wp\/v2\/lsvr_faq_tag?post=2325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}