function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Oleksandr Generalov 1Oleksandr Generalov 1 

Apex from executeanonymous()

Hi!
I know that method executeanonymous() can call Apex code.
How can I do it from PHP using php toolkit.? There is no documentation aboiut it..
Thank you!
KevinPKevinP
Oleksandr,

I'm not aware of a way to do so from the PHP toolkit. To my knowledge the PHPToolkit only has access to the partner/enterprise sObject Soap API. the Execute Anonymous is only avialable via the Tooling API and the Metadata API. 

That said, if you'd like you can create a custom REST endpoint, and have it's method use apex and the Metadata Wrappers to call execute anonymous.  For more information on how to do that see my blog post on metaprograming apex here: http://codefriar.com/2014/10/30/eval-in-apex-secure-dynamic-code-evaluation-on-the-salesforce1-platform/