Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / Data entity methods ex...
Finance forum

Data entity methods execution sequence

(0) ShareShare
ReportReport
Posted on by 6,455

Hi,

I could find any resource which describes the call / execution sequence of data entity methods.

Can anyone provide some link or sequence?

Thanks.

  • nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Data entity methods execution sequence

    Do you do a cross company query from Power BI? Or how do you call the entity?

    And what about sharing your code, would you mind doing that?

  • Rizwan Shahid Profile Picture
    15 on at
    RE: Data entity methods execution sequence

    yes, it is only getting executed for the data of company selected as default in users option of sys admin.

    basically i need to use that particular data entity for my BI dashboard so when i display that entity in BI it only shows my written code results in the fields of default company.

    need help on this what can i do to solve this issue, i want to execute code for the records of all the legal entites in the system

  • nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Data entity methods execution sequence

    Do you mean that postLoad gets executed only in default company of the user? Did you verify it in debugger? How did you run the entity? OData, data management project, something else?

    Can you share your code?

  • Rizwan Shahid Profile Picture
    15 on at
    RE: Data entity methods execution sequence

    i have written a piece of code in postload method, but it is running only on the default legal entity, else than all the entities in the system.

    i mean i have am just getting the execution of my code on default entity.

    is there any way i can run it for all the entities despite what so ever the default entity is ?

    [quote user="AX_Dev"]

    Hi,

    I could find any resource which describes the call / execution sequence of data entity methods.

    Can anyone provide some link or sequence?

    Thanks.

    [/quote]
  • Suggested answer
    Andrew Xu Profile Picture
    3,877 on at
    RE: Data entity methods execution sequence

    here's a post with more details,

    https://axatoz.wordpress.com/2019/03/10/d365-data-entity-sequence/

  • Verified answer
    Martin Dráb Profile Picture
    233,025 Most Valuable Professional on at
    RE: Data entity methods execution sequence

    Eugene Tsuprenko posted this on Yammer (Dynamics 365 for Operations and AX Feedback Community) a few years ago:

    Here is a sequence of method’s calls during export:
    1. initValue
    2. validateField
    3. validateWrite
    4. update
    4.1. doUpdate
    4.1.1. persistEntity
    4.1.1.1. doPersistEntity
    4.1.1.1.1. initializeDataSources
    4.1.1.1.1.1. initializeEntityDataSource
    Note: initializeDataSource is called once for each DataSource in Entity.
    4.1.1.1.2. mapEntityToDataSources
    Note: initializeDataSource is called once for each DataSource in Entity.
    4.1.1.1.3. saveDataSources
    4.1.1.1.3.1. updateEntityDataSource
    4.1.1.1.4. mapEntityToDataSource (maybe for another record)
    4.1.1.1.5. saveDataSources
    4.1.1.1.5.1. updateEntityDataSource for update operation and (insertEntityDataSource for insert)
    4.1.1.1.5.1.1. mapDataSourceToEntity
    4.1.1.1.5.1.2. doSaveDataSource
    4.1.1.1.5.1.2.1. updateDataSource
    4.1.1.1.5.1.2.1.1. preupInsertDataSource
    4.1.1.1.5.1.2.1.1.1. validateWrite of table
    Plus:
    postLoad
    This method is called during the export for setting the value to unmapped fields after entity was downloaded to datasource.

  • Sukrut Parab Profile Picture
    71,682 Moderator on at
    RE: Data entity methods execution sequence

    Its not define anywhere . What do you want to do ? If you can provide more information on what you want we can help .

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,283 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,025 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans