web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Restore/Recreate Delete phone call activities in CRM

(0) ShareShare
ReportReport
Posted on by 155

User deleted about 20k phonecall activities in CRM. Audit history is enabled on phone call and i was able to see all 20K records. How can i restore/recreate all 20k records? I tried XRMtoolbox Recycle bin but it only restores 5k records. Deleted records have both completed and open phone calls. 

I tried the following code but it doesn't create completed phone call activities. Error :2 is not a valid status code for state code PhoneCallState.Open on phonecall with Id . please suggest on how i can create the completed activities using the code or any alternate methods to restore the records.

//retrieve the audit records from fetchxml
                var auditrecords = service.RetrieveMultiple(new FetchExpression(fetchXML));

                //loop through each audit entity record found and create deleted records
                foreach (Entity audit in auditrecords.Entities)
                {
                    // create retrieve audit detail request object
                    RetrieveAuditDetailsRequest auditDetailsRequest = new RetrieveAuditDetailsRequest();

                    //assign audit id value
                    auditDetailsRequest.AuditId = audit.Id;

                    //execute request and retrieve response
                    RetrieveAuditDetailsResponse auditDetailsResponse =
                        (RetrieveAuditDetailsResponse)_service.Execute(auditDetailsRequest);
                 
                    //create auditDetail variable and assign its value
                    AuditDetail auditDetail = auditDetailsResponse.AuditDetail;

                    //type cast audtitDetail as AttributeAuditDetail
                     AttributeAuditDetail attributeAuditDetail = auditDetail as AttributeAuditDetail;

                    //create the deleted record
                     service.Create(attributeAuditDetail.OldValue);
                }

I have the same question (0)
  • Suggested answer
    MikeC282 Profile Picture
    2,171 on at
    RE: Restore/Recreate Delete phone call activities in CRM

    Hi,

    Have you tried this free solution from Cobalt?

    It allows you to restore phone calls from the audit log.

    www.cobalt.net/.../

    Kind regards,

    Mike

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 127

#1
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 127

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 125 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans