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

Delete Records From Salesforce

 

Drag and drop Salesforce query Connector to query the data to delete

 

Create the payload to delete the Account in salesforce

Delete Records From Salesforce

 

Drag and drop the salesforce delete connector (you can also pass the Id directly in salesforce delete connector)

Delete Records From Salesforce

 

Deploy the application and test, you can see account get deleted from Salesforce

 

  
Thank you for taking out time to read the above post. Hope you found it useful. In case of any questions, feel free to comment below. Also, if you are keen on knowing about a specific topic, happy to explore your recommendations as well.
 
For any latest updates or posts on our website, you can follow us on LinkedIn. Look forward to connecting with you there.


Share this:
Subscribe
Notify of
guest
3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Akash
Akash
5 months ago

I want to delete all records from Salesforce custom object. What will be the best way to do this?

Debanku
Debanku
13 days ago

What is maximum size of payload (containing ids to delete) can this Salesforce delete connector handle ?