Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
executeanonymous()
Executes a block of Apex.
Syntax
1ExecuteAnonymousResult[] = binding.executeanonymous(string apexcode);Usage
Use this call to execute an anonymous block of Apex. This call can be executed from AJAX.
This call supports the API DebuggingHeader and SessionHeader.
If a component in an unmanaged or unlocked package with restricted API access issues this call, Salesforce blocks the request.
Salesforce blocks all executeanonymous() requests from components in managed packages. See Block Execute Anonymous from Managed Packages (Release Update).
Apex classes and triggers saved (compiled) using API version 15.0 and higher produce a runtime error if you assign a String value that is too long for the field.
Arguments
| Name | Type | Description |
|---|---|---|
| apexcode | string | A block of Apex. |