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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Data Migration - To change standard field values during data migration

(0) ShareShare
ReportReport
Posted on by 575

We are migrating data from POS system to D365 for customers.

One of my requirement is, the created date in POS should be imported in D365 as well. So we need to over write the standard field created date in customer master.

1. I tried to create a runable class to check whether we are able to change the system fields and yes it is possible at the time of insertion and not during update. And it should run in server side

         public static void main(Args _args)
           {
                 CustTable CustTable 
                 ;
                ttsbegin;
                 New OverwriteSystemFieldsPermission().assert();
                 CustTable.AccountNum = "1234";
                 CustTable.overwriteSystemfields(true); 
                 CustTable.(fieldNum(CustTable, createdBy)) = "abs";
                 CustTable.(fieldNum(CustTable,createdDatetime)) = DateTimeUtil::newDateTime(today()-30, 0, DateTimeUtil::getCompanyTimeZone());
                 CustTable.insert();

                 ttscommit;
                 CodeAccessPermission::revertAssert();
            }

2. Now in customer data entity level, I have created a virtual field to store the data from Source file to staging.

      But now i am not getting, where to write code in entity level to change the system filed value of customer table.

      I tried in event "CustCustomerV3Entity_onFindingEntityDataSource" but i couldn't get the data source of customer

Regards

Arun B S

I have the same question (0)
  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Moved to the D365 forum

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,095 on at

    Hi,

    You can check several standard entities and how they work with virtual fields. For example, EcoResReleasedProductV2Entity.Update or PurchPurchaseOrderLineV2Entity.mapEntityToDataSource. It would be quite interesting to know if you could achieve your requirements with an entity.

    An alternative solution could be to create a custom field and import old data to it and create SR to MS and ask to update standard created date and time with values from a custom field.

    BR, Sergey

  • WillWU Profile Picture
    22,363 on at

    Hi Arun,

    You can also create customers by coding,

    Write a class to read the customer data from your POS or Excel and pass them as the parameter in the method to create customer.

    Please refer to the following codes about create customers by X++:

    https://community.dynamics.com/365/financeandoperations/b/365foandaxtechnicalworld/posts/create-customer-using-x-d365fo-amp-ax-2012

  • Suggested answer
    Rahul Mohta Profile Picture
    21,046 on at

    during import in data management project, you could specify default values in the target mapping which should help in providing defaults

  • Community Member Profile Picture
    on at

    I would recommend not to change the created date time.

    I think you are trying to import historical data. Best is to create a new field or a log. It could create issues in some cases.

    As mentioned, Try it in mapEntityToDataSource(import)/postLoad(export) to populate from or to virtual fields.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 660

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 655 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 557

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans