Data loss comes in different forms, and some situations need a slightly different approach for restoring records quickly. Losing a hierarchy of Salesforce records when the parent record has been deleted is a common scenario. For example, when an Account record is accidentally deleted all the associated Opportunity records are also lost. Gearset's backup solution has a dedicated workflow for this kind of incident so you can restore everything in just one deployment.
The knock-on effects of one accidental deletion
When you delete a record in Salesforce, its child and grandchild records are also deleted. For example, if you delete an Account record, all the associated Opportunities and OpportunityLineItems will be deleted as well. This behavior is logical and useful when the deletion is wanted - it cleans up your org and gets rid of redundant data. But when a parent record has been deleted by accident, or needs to be restored for any other reason, the knock-on effects of that one deletion add to your workload for restoring data.
If you're not currently backing up your data, this situation would leave you working out which other records have been lost, then recreating them manually and rebuilding the relationships. Even if you back up your data using Data Export, it'll still take a fair amount of head-scratching and several steps to restore them.
Reversing data loss in one go
An accidental deletion that's so easy to cause should be just as easy to recover from. Gearset's workflow for restoring a lost hierarchy of data when a parent record has been deleted reverses what went wrong: one restoration deployment for one mistake. Gearset walks you step by step through the process of building a restore plan with the parent record as the base. You can select all the child and grandchild records you want to restore along with the parent record.
How does it work?
Let's see this restore workflow in action! Imagine that we work for Acme Corporation and one of our customers, Ethan J. Robinson, has expressed interest in a couple of products. Our salesperson adds an Opportunity record on Ethan's Account - this is a child record. Then they add the products that Ethan is interested in. This information is recorded with OpportunityLineItem records - these are child records of the Opportunity and grandchild records of the Account.
But then Ethan gets in touch to say he isn't interested after all and no longer wants to be a customer. Our colleague at Acme Corporation turns out to be a rogue sales operative, and decides to delete the whole Account rather than mark the Opportunity as closed lost, because that would harm their win rate. Yes, this kind of thing really happens!
When the sales rep deletes Ethan's Account record, all of the child and grandchild records - the Opportunity and the OpportunityLineItems - are deleted as well.
The next day Ethan calls back. He's changed his mind, and wants to know more about those two products. The salesperson comes to us, confesses their error and asks for help - this makes sense of the smart alert we received from Gearset this morning, warning that someone had deleted an Account!
How do we restore Ethan's Account record along with all of its child records? Thankfully, we have the records backed up by Gearset, and today's run of our backup job shows that these records have been deleted. We could restore using the usual restore flow in Gearset's backup solution. But for this particular situation, we're better off restoring the whole hierarchy of data in one run.
From the Run details page, we can see the option to Restore changed and deleted records. Clicking on this button launches the workflow for restoring a hierarchy of data based on a parent record. We want to restore the hierarchy of data based on Ethan's Account record, so we'll click on this button for the Account row.
By opening up all of the dropdowns on this next page, we can see all the objects that hold the child and grandchild records of our deleted Account record - in this case Opportunities and OpportunityLineItems (the products Ethan wanted to buy). We select all of those objects to include them in the restore process.
At this point, we notice that Ethan's Account records wasn't the only one to have been deleted or changed - there are 13 deleted records and 9 changed records in total. We only want to restore the hierarchy of data associated with Ethan's Account, so we open up the filter on the column labelled Total records to restore. There are plenty of options here for filtering down to the records we're interested in - using Ethan's name is an easy way to do it!
Now we can see that Gearset has filtered out all the other records and will just restore Ethan's Account record, the associated Opportunity, and the two OpportunityLineItems. We're ready to click Preview restore.
Gearset now shows us the complete plan for restoring our lost records. Teams using Gearset for data deployments will find that this feels familiar, because restoring records is essentially the same as deploying data. And this familiarity is a real advantage when you're in the middle of a stressful situation needing to restore as quickly and reliably as possible! All of the steps in this deployment plan look good, so we hit Deploy data.
A few moments later, the restoration deployment has completed successfully, and Ethan's Account is back online along with the Opportunity record and all the information about the products he's interested in purchasing. Our sales rep, hopefully having realized the error of their ways, lives to sell another day.
While this example deals with just a handful of records on standard objects, the same restore workflow can be used just as easily for much larger quantities of data on custom objects. It's a way of visualizing and planning the restore process that matches how we tend to think about this kind of data loss incident, and it streamlines the recovery process very effectively.
We're piloting this new workflow and gathering feedback
At the time of writing, this workflow is currently being piloted - let us know how you get on with it! As always, we love getting any and all feedback from you so we can keep improving the product. There are a couple of things we already plan to add. We're currently adding support for objects with binary fields. We're also looking to add support for restoring child records that are on the same object as the parent record. If you see anything else you think we should consider adding, don't hesitate to get in touch via our live chat.
Back up and restore Salesforce data with confidence!
The example we've looked at in this post shows just how easy it is to lose countless records with a single click. And these incidents aren't always caused by rogue salespeople! As a perceptive user told me: "I need this to protect me from myself!" One accidental or misguided deletion can have several knock-on effects that quickly escalate to become a data loss incident your manual backup and restore processes can't cope with at all well.
Data loss is surprisingly common, comes in all shapes and sizes, and can be caused by human error, malicious action, or a data integration that doesn't go to plan. The metadata that shapes your org also needs to be protected, because it's costly to lose all your customization, and you're one bad release or outage away from that happening. Get started with Gearset's backup solution and recover from any data loss quickly and reliably.