Skip to content

executeApex

executeApex(connection, apexFilePath): Promise<ApexExecuteResult>

Defined in: packages/simply-apex-core/src/apexExecute.ts:58

Executes an anonymous block of Apex code from a local file against connection and returns the compile/execution result, including any debug logs produced.

Connection

The org connection to execute against.

string

Path to the local .apex file to execute.

Promise<ApexExecuteResult>

The compile/execution result.

compile-failed if the Apex didn’t compile, execute-failed if it compiled but threw during execution. Either way, error.result carries the full result so a caller can still inspect line/column/logs.