salesforce_write_apex
Create or update Apex classes in Salesforce to implement custom business logic and automate processes within the CRM platform.
Instructions
Create or update Apex classes in Salesforce.
Examples:
Create a new Apex class: { "operation": "create", "className": "AccountService", "apiVersion": "58.0", "body": "public class AccountService { public static void updateAccounts() { /* implementation */ } }" }
Update an existing Apex class: { "operation": "update", "className": "AccountService", "body": "public class AccountService { public static void updateAccounts() { /* updated implementation */ } }" }
Notes:
The operation must be either 'create' or 'update'
For 'create' operations, className and body are required
For 'update' operations, className and body are required
apiVersion is optional for 'create' (defaults to the latest version)
The body must be valid Apex code
The className in the body must match the className parameter
Status information is returned after successful operations
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operation | Yes | Whether to create a new class or update an existing one | |
| className | Yes | Name of the Apex class to create or update | |
| apiVersion | No | API version for the Apex class (e.g., '58.0') | |
| body | Yes | Full body of the Apex class |