Add a Salesforce SObject to an Existing Ballerina Project
sf_add_custom_objectAdds a Salesforce SObject to an existing Ballerina project, generating resource-route code for standard or custom objects.
Instructions
Adds a new SObject to an already-scaffolded project. For standard SObjects: creates a .bal file that uses the pre-built type from ballerinax/salesforce.types (no types.bal change needed). For custom (__c) objects: also appends a typed record to types.bal.
Returns the resource-route snippet to paste into main.bal.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | Path to the existing Ballerina project | |
| sf_client_id | Yes | Salesforce Connected App Consumer Key (Client ID) | |
| sf_client_secret | Yes | Salesforce Connected App Consumer Secret (Client Secret) | |
| sf_refresh_token | Yes | Salesforce OAuth2 Refresh Token obtained after authorization | |
| sf_base_url | Yes | Salesforce org instance URL, e.g. https://myorg.my.salesforce.com (sandbox auto-detected from hostname) | |
| object_name | Yes | SObject API name to add, e.g. 'My_Custom__c' |