Update Records in Salesforce
MuleSoft’s Salesforce Connector helps you to accelerate your Salesforce integrations across Sales Cloud, Service Cloud, Salesforce Platform, and Force.com. The connector gives you access to all Salesforce entities to enable automation of your business processes to help maximize your investments in services and solutions like enabling your sales teams, increasing revenue, and serving your customers better. This connector:
- Provides a powerful solution to implement top Salesforce integration patterns.
- Supports all create, read, upsert, and delete operations across Salesforce objects. Additionally it supports Salesforce’s bulk operations that are optimized for working with large sets of data.
- Enables you to easily leverage custom fields and custom entities to solve integration needs to your custom Salesforce instance.
In this tutorial we have demonstrated how can we we update the records in salesforce either on Salesforce standard object or custom object
Prerequisites:
- Installing salesforce connector (by login into anypoint exchange from studio you can install the salesforce connector)
- Salesforce developer account
- Security token
- Consumer key and secret(If you are using the Salesforce connector to access an OAuth API, you also need a consumer key and secret)
As a use case we will Update an Account object in Salesforce using salesforce connector
Create project in anypoint studio
Drag and drop Salesforce Query Connector to get the details of the salesforce account
Configure the connection details for salesforce and use the Basic Username and Password connection(Username,Password,Securitytoken),you can also use other connections as well to do the configuration like Oauth UserName and Password etc
Set the account number
Get the Object details using Query connector
Create transform message to update the account( Pass the Id fields and other parameters to update the salesforce account)
Drag and drop the salesforce update connector
Deploy the application and test
Test2 account is updated in salesforce see the updated details below
Nice explanation.
Salesforce update connector seems to have limit of 200. What is the work around for this. Bulk v2 update needs extra permissions in few cases.
While update records from database to salesforce have to set limit of 200 records.
If any know comment here.
Yes that is the Salesforce REST API limit so we have to send 200 records once and if more than that need to use for loop to only send 200 at once, if the records count is high then going with bulk operation like v2 jobs is more suggested approach.
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_sobjects_collections_update.htm Same limits applicable to our Update connector.
Here is the alternative if want to update more than 2000 records
https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_intro.htm