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. |