Loading...

Recycle Bin Dataverse

Recycle Bin Dataverse
Recycle Bin Dataverse joao.neto Thu, 07/04/2024 - 14:40
Body

Intro

Have you deleted some Dataverse records accidentally and you're struggling how to managed it ?

The new Recycle Bin feature in preview might be what it solves your problem.

It allows Administrator only (in the preview version) to recover user deleted records up to 30 days!

How it Works

First we need to ensure that the feature is activated doing it this way_

  • Going to the Settings -> Product -> Features in the admin center
  • setup
  • Trying to set a recovery interval bigger that 30 days will fail !

 

Second to view and restore the deleted records:

  • Go to your environment Settings -> Data Management -> View Deleted Records
  • view deleted records
  • And in this view will be able to view and restore all deleted records
  • view deleted records

Third, you can also use the Organisation Service in .net or the WebApi to:

  • Retrieve deleted records (web api example)
$query = @()
   $query += ""
   $query += ""
   $query += ""
   $query += ""
   $query += ""

   $uri = $environmentUrl
   $uri += 'accounts'
   $uri += '?fetchXml=' + [uri]::EscapeUriString($query -join '')

   $RetrieveMultipleRequest = @{
      Uri     = $uri
      Method  = 'Get'
      Headers = $baseHeaders
   }
   Invoke-RestMethod @RetrieveMultipleRequest

 

  • Restore deleted records (.net example)
/// 
/// Restores an account record
/// 
/// The authenticated IOrganizationService instance
/// The ID of the deleted account record.
/// The original name value for the account record.
/// The ID of the restored account
static Guid RestoreAccountRecordEarlyBound(
    IOrganizationService service, 
    Guid accountId,
    string originalName)
{
    Account accountToRestore = new()
    {
        Id = accountId,
        // Appending '(Restored)' to the original name
        // to demonstrate overwriting a value.
        Name = originalName + " (Restored)"
    };

    RestoreRequest request = new()
    {
        Target = accountToRestore
    };

    var response = (RestoreResponse)service.Execute(request);
    return response.id;
}

Points in atenttion

 

Final thoughts

The Dataverse Recycle bin it's a must to regarding business data recovery and we can't wait for the final announce of it's general availability.

 

 

Image
/sites/default/files/2024-08/Cover.png

Published on:

Learn more
Need help with this product?

We can help you with Recycle Bin Dataverse

If you want help implementing, troubleshooting, or improving this product, contact us and we’ll point you in the right direction.

Featured Articles | Dynamics Chronicles
Featured Articles | Dynamics Chronicles

Welcome to our blog, the content is entirely dedicated to Microsoft Dynamics 365, CRM, Power Platform, Common Data Service (CDS) but also Azure. Follow us !

Share post:

Related posts

Generative pages in model-driven apps: a practical guide

What generative pages are, where they stand in November 2026, the two ways to build them, the code they produce, and the limits to plan for.

2 days ago

Big Update — CRMJetty Dynamics 365 Portal Now Comes with Powerful New Integrations

Enterprise portals are evolving rapidly. They are no longer mere portals through which CRM records can be viewed. Portals are now expected to ...

7 months ago

Power Apps Code Apps in Practice: Recreating Model-Driven App Patterns

Power Apps Code Apps went from preview to general availability in record time. With that, Microsoft has sent a clear signal that it is taking ...

8 months ago

Use XRM type definition in your Javascript file

We implement Javascript webresource for form scripting (form onload, field on change,...). Our code need to follow the official document Xrm o...

9 months ago

Dataverse Functions Deep Dive

Microsoft released in 2024 Dataverse low-code plugins. The promise was great : writing plugins using low-code tools. No need to have developme...

10 months ago

Dataverse : Get Audit Storage by table

Dynamics 365 auditing feature logs changes made to records, allowing you to view the details of those changes at any time. Whenever a record i...

10 months ago

D365 Sales -2025 Wave release

In this post, we highlight the latest releases from Microsoft D365 Sales' 2025 Wave updates. For a detailed breakdown, click here. Public Prev...

10 months ago

10 Ways Dynamics 365 Calendar Boosts Productivity for Sales & Support Teams

In today’s fast-paced business environment, time is the most valuable resource for both sales and support teams. Managing appointments, meetin...

10 months ago

Newsletter

Get the latest Dynamics 365 and Power Platform content in your inbox

A curated digest of community blogs, product news, videos, and podcasts — delivered without the noise.

Weekly updates Unsubscribe anytime Fresh community picks
We use your email only for the newsletter and you can unsubscribe at any time.
By subscribing, you agree to the privacy policy.