Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Fixing displayed date for imported Phone Call records

Posted on by Microsoft Employee

We're importing a large number of Phone Call (Activity) records into Dynamics 365 and I need to preserve last modified date and user.

I am very familiar with the issues around ModifiedBy and ModifiedOn, and I have a custom plugin that takes the entity on create and mirrors the ownerid and CreatedOn values to the modified fields.

This works great for Notes but isn't working with Phone Call records.

Actually, my code is working - my plugin is firing, the code is executing, and I am successfully updating all my target fields, including ModifiedOn.  But on the Contact page, the Activities widget still shows today's date and the support account that ran the import!  I'm losing my mind.

For testing, I am overwriting the Description field with every DateTime field in the record, to try and see where the widget date is coming from.  Here's what I get:

CreatedOn: 12/2/2006 5:58:24 PM
ModifedOn: 12/2/2006 5:58:24 PM
ActualStart: 12/2/2006 5:58:24 PM
ActualEnd: 12/20/2006 10:39:45 PM
ScheduledStart: 1/1/0001 12:00:00 AM
ScheduledEnd: 1/1/0001 12:00:00 AM
DeliveryLastAttemptedOn: 1/1/0001 12:00:00 AM
LastOnHoldTime: 1/1/0001 12:00:00 AM
SortDate: 12/2/2006 5:58:24 PM
OverriddenCreatedOn: 1/13/2018 8:38:45 PM

5342.Capture.PNG

Where is this "Completed" date coming from???  My understanding is that OverriddenCreatedOn is just a place to store the "real" date when you override CreatedOn during import.  It shouldn't be affecting this widget. I've set ActualEnd, CreatedOn, and ModifiedOn.  I'm checking everything else just to be sure I'm not missing something.  There is no "CompletedBy" date on the entity.

And like I said, the exact same code works great with Notes.

Any help is much appreciated!

*This post is locked for comments

  • Syed Ibrahim Profile Picture
    Syed Ibrahim 6,257 on at
    RE: Fixing displayed date for imported Phone Call records

    I cant visualize .try to enable trace and see. Hope that helps

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Fixing displayed date for imported Phone Call records

    Adding to the mystery:

    * We had a workflow on the Phone Call entity. I disabled it, thinking that was the problem.  No improvement.

    * We are setting the Status to Completed on import.  This is causing the issue! Something in the completion process (and not my workflow) is touching the record again and affecting the ModifiedBy/On values.  There are no other plugins targeting this entity type.

    * BUT if I import without setting Status, the record looks good at first, but simply opening the record does something to trigger an update, and the ModifiedBy/On is immediately reset.  This is true even leaving Status = Open, and not touching any fields.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Fixing displayed date for imported Phone Call records

    Thanks for your help.  I'm not sure what the Sdk Message Processing Steps have to do with anything, or what an Auto post is, exactly.  (I'm fairly new to CRM.)  I only see one entry for Phone Call: the Create message associated with my plugin. And I definitely want that.

    I'm just trying to figure out what's different about Phone Calls / Activities.  My process (even using the same plugin) is rock-solid with Notes.

    The on-line confusion (and bickering) around this is almost funny.  CRM documentation seems to be really lacking.

    stackoverflow.com/.../dynamics-2013-how-can-i-set-the-modified-on-value-for-activities-that-i-am-impor

  • Suggested answer
    Syed Ibrahim Profile Picture
    Syed Ibrahim 6,257 on at
    RE: Fixing displayed date for imported Phone Call records

    Yeah for the dates you can set. I have tested as well  its not taking the modified by for the Auto post. Try couple of things.

    1.Turn off the Auto post before import

    Refer:community.dynamics.com/.../151403

    2. Set post created by the modified user or created by.

    Hope this helps.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Fixing displayed date for imported Phone Call records

    Thanks for replying. Maybe I wasn't clear.  The Activity is Completed and I have programatically set both ActualEndDate and ModifiedOn to the historical end date using a "create" pre-processing plugin.  Those old dates are what show in the record.  But on the Contacts page, in the Posts|Activities|Notes widget, the records shows a "Completed by" value with the importing user and import date. I cannot find where this data is coming from since I have overwritten all the dates using the plugin.  The list of dates in the question are the actual field values as seen by the plugin and shown in the Description field (for testing).

  • Suggested answer
    Syed Ibrahim Profile Picture
    Syed Ibrahim 6,257 on at
    RE: Fixing displayed date for imported Phone Call records

    Hi Nlaselt,

    When an activity is completed you can update the "Actual End Date" to show actual time instead of last modified date. In your case if the status code is completed set the last modified date to "actual end date".

    Just have a reference below

    community.dynamics.com/.../224137

    Hope this helps.If the suggestion resolved your query .Pls mark it as answered/verified to close the thread.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans