Execute Apex runs a block of anonymous Apex against a connected org and returns the debug output. It is the quick way to run a one-off script, a data fix, or a post-deployment step without leaving Serpent or opening the Developer Console.
What you can use it for
- Run a one-off data fix or backfill against a sandbox before a release.
- Trigger a post-deployment step, such as scheduling a job or seeding a record.
- Check behaviour quickly by running a snippet and reading the debug log.
Run it in the demo
Execute Apex runs from a Work Item. Open a Work Item with the "Try it in the demo" button above, then:
-
Open Execute Apex
On the Work Item, open More actions and choose Execute Apex.
-
Pick the org
Choose the connected org to run against. Run against a sandbox or scratch org first, not production.
-
Add your Apex
Paste or write the anonymous Apex you want to run.
-
Run and read the output
Run it, then read the returned debug output to confirm what happened.
Tracked like any action
Execute Apex is a Serpent action, so each run is recorded with its output and status. You can see it in the action history and follow up if something needs attention.