Delete Records From Salesforce
After you persist records in the database, you can delete those records using the delete operation. Deleted records aren’t deleted permanently from Salesforce, but they are placed in the Recycle Bin for 15 days from where they can be restored.
In this tutorial we have demonstrate how can we Delete Records From Salesforce using delete operation of Salesforce connector in Mule 4
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 delete the records from Account object in Salesforce using salesforce connector
Create project in anypoint studio and configure the listener to trigger the request
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
Drag and drop Salesforce query Connector to query the data to delete
Create the payload to delete the Account in salesforce
Drag and drop the salesforce delete connector (you can also pass the Id directly in salesforce delete connector)
Deploy the application and test, you can see account get deleted from Salesforce
I want to delete all records from Salesforce custom object. What will be the best way to do this?
You can use bulk delete to delete all the records from SF object.
Thanks,
Mulesy Team
What is maximum size of payload (containing ids to delete) can this Salesforce delete connector handle ?
200 for the non bulk api
im getting an error string cannot not be coersive tot array