Retrieving, Updating, Upserting, and Deleting Records
In Part III, we focus on Salesforce Composite CRUD operations and explain how MuleSoft Salesforce Integration retrieves, updates, upserts, and deletes records using sObjects. Previously, Part I introduced Salesforce sObjects and common Apex types, while Part II covered collections and data preparation for bulk processing.
As a result, this final part of the series demonstrates how Composite API capabilities support full record lifecycle management while maintaining transactional control and predictable execution behavior.
Retrieving Salesforce Records
Salesforce sObject operations allow you to retrieve one or more records of the same type within a single Composite API request. As a result, integrations reduce API calls and improve overall performance.
When retrieving records:
- Each request targets records of the same sObject type
- The number of sObjects returned matches the number of record IDs provided
- Additionally, Salesforce preserves the order of records in the response
Because request and response sizes align, MuleSoft simplifies downstream transformations and error handling.
Updating Records with Composite API
Salesforce Composite CRUD supports updating multiple records in a single request, which is especially useful for batch-driven integrations. At the same time, MuleSoft provides control over transactional behavior.
Key characteristics of update operations include:
- Update up to 200 Salesforce records per request
- However, the operation does not create new records when a target record does not exist
- Moreover, you can configure whether the entire request rolls back if an error occurs
Therefore, teams can balance performance requirements with data consistency expectations.
Upserting Records Using Salesforce sObjects
Composite API CRUD operations also support upserting Salesforce records using an external ID field. Consequently, integrations can safely handle scenarios where record existence remains uncertain.
Important aspects of upsert operations include:
- Create or update up to 200 records using an external ID
- Additionally, you can configure rollback behavior when errors occur
- Salesforce processes records in the exact order listed in the request body
- As a result, responses return in the same order as the request
Because order remains consistent, Salesforce Composite CRUD operations ensure predictable mappings between input records and response results.
Deleting Salesforce Records
Salesforce Composite CRUD operations allow you to delete multiple records within a single request. This approach simplifies cleanup tasks and supports consistent data lifecycle management.
Key points for delete operations include:
- Delete up to 200 Salesforce records per request
- The response returns a list of delete results
- Furthermore, you can configure full rollback behavior if an error occurs
Thus, teams can safely remove records at scale while maintaining control.
Best Practices for Salesforce Composite CRUD
These integrations follow widely accepted RESTful API design best practices, ensuring consistency, scalability, and predictable behavior. When working with Salesforce Composite CRUD operations, teams should follow several best practices to improve reliability and maintainability.
For example:
- Group records logically to remain within API limits
- Use rollback options carefully for large transactions
- Validate external IDs before running upsert operations
- Additionally, log reference IDs to simplify troubleshooting
By following these practices, MuleSoft integrations remain scalable and easier to support.
Conclusion and Series Summary
With Part III, this series now provides a complete view of Salesforce sObject operations using the MuleSoft Composite Connector. While Part I established foundational concepts and Part II prepared data for bulk processing, this final article demonstrates how Salesforce Composite CRUD enables full lifecycle record management.
Together, these patterns show how MuleSoft supports efficient bulk operations while maintaining control, consistency, and performance across Salesforce integrations.