Discoverable Procedures

These procedures are created automatically when you discover specific Salesforce objects. Each discovery creates ten different procedures for that object.

Discovery Process

Command: discover [OBJECT_TYPE] from salesforce

It can be both a string or a noun phrase, where the Object Type is the Salesforce Object’s name.

Examples

discover "contact" from salesforce
discover opportunity from salesforce
discover "account" from salesforce

Entity Name Pluralization

The Salesforce book automatically creates proper plural forms for discovered objects using intelligent pluralization rules.

Examples

Object Type
Singular Usage
Plural Usage

contact

create a contact

retrieve contacts

opportunity

create an opportunity

retrieve opportunities

account

create an account

retrieve accounts

case

create a case

retrieve cases

Finding Object Names

  • Salesforce object names are typically lowercase (e.g., "contact", "opportunity")

  • Custom objects usually end with "__c" (e.g., "custom_product__c")

  • Use Salesforce setup to find exact object API names if needed


Discoverable Procedures

After discovery, you can use these ten generated procedures for that object.

1. Create a Single Record

Command: create a [object] in salesforce

Purpose: Create a new record of the discovered object type.

Required Parameters:

  • the body is [DATA] - The data for the new record

Example:

Returns: The newly created record with all fields populated.


2. Create Multiple Records

Command: create some [objects] in salesforce

Purpose: Create multiple records of the same object type in a single operation.

Required Parameters:

  • the bodies are [DATA_LIST] - List of data for multiple records

Example:

Returns: List of newly created records.

Important Notes:

  • If any record fails, all successfully created records are automatically rolled back

  • Provides transactional safety for bulk operations


3. Retrieve Records

Command: retrieve [objects] from salesforce

Purpose: Get a list of records from the discovered object type.

Optional Parameters:

  • the limit is [NUMBER] - Maximum number of records to retrieve (default: 10)

  • the offset is [NUMBER] - Number of records to skip for pagination

  • whose [FIELD] is [VALUE] - Filter records by specific criteria

Examples:

Returns: A list of records matching the criteria.


4. Delete Single Record

Command: delete a [object] in salesforce

Purpose: Delete a specific record.

Required Parameters:

  • the [object] is [RECORD] - The record to delete

Example:

Returns: None (deletes the record).


5. Delete Multiple Records

Command: delete some [objects] in salesforce

Purpose: Delete multiple records in a single operation.

Required Parameters:

  • the [objects] are [RECORD_LIST] - The records to delete

Example:

Returns: None (deletes the records).

Important Notes:

  • Reports any records that failed to delete

  • Continues processing even if some deletions fail


6. Update Record

Command: update a [object] in salesforce

Purpose: Update an existing record with new data.

Required Parameters:

  • the [object] is [RECORD] - The record with updated data

Example:

Returns: None (updates the record).

Important Notes:

  • Automatically filters out non-updatable fields

  • Only sends changed data to Salesforce


7. Upload Attachment

Command: upload an attachment to a [object]

Purpose: Attach a file to a Salesforce record.

Required Parameters:

  • the [object] is [RECORD] - The record to attach the file to

  • the file is [FILE] - The file to upload

  • the file name is [NAME] - Name for the attached file

Example:

Returns: None (uploads the attachment).


8. Download Attachments

Command: download attachments from a [object]

Purpose: Download all attachments from a Salesforce record.

Required Parameters:

  • the [object] is [RECORD] - The record to download attachments from

Optional Parameters:

  • whose [FIELD] is [VALUE] - Filter attachments by criteria

Example:

Returns: List of file attachments.


9. Delete Attachments

Command: delete the attachments from a [object]

Purpose: Delete all attachments from a Salesforce record.

Required Parameters:

  • the [object] is [RECORD] - The record to delete attachments from

Optional Parameters:

  • whose [FIELD] is [VALUE] - Filter which attachments to delete

Example:

Returns: None (deletes the attachments).


10. Submit for Approval

Command: submit a [object] for approval

Purpose: Submit a record to a Salesforce approval process.

Required Parameters:

  • the [object] is [RECORD] - The record to submit (must have Id and OwnerId)

  • the process is [PROCESS_NAME] - Name of the approval process

Optional Parameters:

  • the comment is [COMMENT] - Comment to include with submission

Example:

Returns: None (submits for approval).

Important Notes:

  • Record must have both Id and OwnerId fields

  • Process name must match exactly with Salesforce approval process

  • Will error if record is already in an approval process


Tips for Success

Object Discovery

  • Use lowercase object names: "contact", "opportunity", "account"

  • For custom objects, include the "__c" suffix: "custom_product__c"

  • Discover objects before using their specific procedures

Working with Data

  • Use create a json to build record structures

  • Use set the [variable]'s "[field]" to "[value]" to populate fields

  • Check Salesforce field requirements (required vs optional fields)

Bulk Operations

  • Use plural procedures for efficiency with multiple records

  • Bulk create operations provide automatic rollback on failure

  • Bulk delete continues processing even if individual records fail

Attachments

  • Attachments are stored using Salesforce's ContentDocument system

  • File name parameter is required for uploads

  • Downloads return all attachments as separate files

Approvals

  • Records need the Id and OwnerId fields for approval submission

  • Process names must match exactly with the Salesforce setup

  • Check the approval process configuration in Salesforce admin

Reports

  • Export options include Excel files and data tables

  • Data table export is useful for further data processing

  • Report filters use standard Salesforce field names


Troubleshooting

Connection Issues

  • Username/Password: Verify credentials and security token are current

  • Permissions: In case of authorization errors, check user has appropriate Salesforce permissions

Discovery Issues

  • Use exact Salesforce API object names (usually lowercase)

  • Check object exists and is accessible to your user

  • Custom objects need "__c" suffix

Record Operations

  • Required Fields: Check Salesforce object setup for required fields

  • Field Names: Use exact API field names (case-sensitive)

  • Permissions: Ensure user can create/update/delete specific objects

Attachment Issues

  • File Size Limits: Salesforce has file size restrictions

  • File Types: Some file types may be blocked by organization settings

  • Storage Limits: Check available file storage in Salesforce

Approval Issues

  • Process Names: Must match approval process exactly as configured

  • Record State: Records already in approval can't be resubmitted

  • Required Fields: Record must have both Id and OwnerId populated

Email Issues

  • Email Addresses: All recipients must be valid email addresses

  • Email Deliverability: Check Salesforce email deliverability settings

  • Permissions: User must have permission to send emails through Salesforce

Last updated

Was this helpful?