{"id":1822,"date":"2009-11-06T03:51:58","date_gmt":"2009-11-05T22:51:58","guid":{"rendered":"http:\/\/www.chiragmehta.info\/chirag\/?p=1822"},"modified":"2009-11-06T03:51:58","modified_gmt":"2009-11-05T22:51:58","slug":"salesforce-know-how-anonymous-block","status":"publish","type":"post","link":"https:\/\/www.chiragmehta.info\/chirag\/2009\/11\/06\/salesforce-know-how-anonymous-block\/","title":{"rendered":"Salesforce &#8211; Know-How : Anonymous Block"},"content":{"rendered":"<ol>\n<li>Unlike classes and triggers, anonymous blocks execute as the current user and can fail to compile if the script violates the user&#8217;s object- and field-level permissions. So, essentially, it is only allows the user to do what they could through the API.<\/li>\n<li>if you don\u2019t have CRUD for delete on Account, you can\u2019t delete Accounts through anonymous blocks.<\/li>\n<li>The Author Apex profile perm, only applies to Apex that is stored in the org\u2019s metadata (i.e. normal Apex Classes and Triggers that run in system mode).<\/li>\n<li>As far as Async Apex (Batch Apex), it\u00a0doesn&#8217;t\u00a0look like it is possible because @future requires the method be static but anonymous blocks can\u2019t have static methods<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Unlike classes and triggers, anonymous blocks execute as the current user and can fail to compile if the script violates the user&#8217;s object- and field-level permissions. So, essentially, it is only allows the user to do what they could through the API. if you don\u2019t have CRUD for delete on Account, you can\u2019t delete Accounts [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[169],"class_list":["post-1822","post","type-post","status-publish","format-standard","hentry","category-salesforce","tag-salesforce","post-preview"],"_links":{"self":[{"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/posts\/1822","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/comments?post=1822"}],"version-history":[{"count":1,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/posts\/1822\/revisions"}],"predecessor-version":[{"id":1823,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/posts\/1822\/revisions\/1823"}],"wp:attachment":[{"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/media?parent=1822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/categories?post=1822"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/tags?post=1822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}