Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

same createdDateTime when creating records

(1) ShareShare
ReportReport
Posted on by
Hi,

How can I make sure that I insert two records in the same table, and these two records have exactly the same createdDateTime? even if i do it in the same transaction would that gurantee that those two records will always have the same exact createdDateTime?
  • Martin Dráb Profile Picture
    233,305 Most Valuable Professional on at
    same createdDateTime when creating records
    Could you react to my first question, please? As far as I know, change tracking isn't based on CreatedDateTime, therefore you seem to be solving a wrong problem.
     
    The change tracking table will be updated when the transaction is committed. If you create both orders in the same transaction, they (and their change tracking entries) will became visible to the rest of the system at the same time (when the transaction gets committed).
     
    Do you have some tests that prove me wrong?
     
    CreatedDateTime isn't available in all tables and it doesn't have any information about updates, which change tracking takes into account.
     
    Regarding your example, you're saying that you created SO2 and SO3 at almost the same time, but then you're saying that you want to export different orders together: SO3 and SO4. To me, it sounds like a very different scenario than what we discussed so far. You talked about orders created in the same transaction at the same time, while SO3 and SO4 were created twenty seconds apart. The fact that you created SO4 before SO3 and SO2 sounds suspicious too.
     
    Which orders did you create in the same transaction?
     
     
  • Martin Dráb Profile Picture
    233,305 Most Valuable Professional on at
    same createdDateTime when creating records
    As far I know, change tracking utilizes SQL Server Change Tracking, not CreatedDateTime field. Am I mistaken?
     
    IsLinked and CreatedDateTime doesn't sounds like a reasonable link of the related orders to me. You should use a SalesId reference, or a separate link table (especially if there may be more than two related orders).
     
    If you use a field for the SalesId reference, you also don't need to create any "dummy" field.
  • Anthony Blake Profile Picture
    2,403 Super User 2025 Season 1 on at
    same createdDateTime when creating records
    As you've found, the Created Date Time isn't a field you can guarantee will be the same across records, so why not just add a custom field. You can treat it however you would like
  • Martin Dráb Profile Picture
    233,305 Most Valuable Professional on at
    same createdDateTime when creating records
    Please explain what business problem you're trying to address, so we can suggest a better solution. The solution you chose is impossible to implement. If records are inserted a second apart, the fact that you see one second difference in CreatedDateTime is the correct behavior and you can't change that.
  • Anthony Blake Profile Picture
    2,403 Super User 2025 Season 1 on at
    same createdDateTime when creating records
    I would use an additional field so that you have control over the contents. CreatedDate/Time can then continue to work as it is supposed to.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 185

#2
Martin Dráb Profile Picture

Martin Dráb 147 Most Valuable Professional

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 130 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans