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 :
Dynamics 365 Community / Forums / Finance forum / Data entity methods ex...
Finance forum

Data entity methods execution sequence

(0) ShareShare
ReportReport
Posted on by 6,480

Hi,

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

Can anyone provide some link or sequence?

Thanks.

I have the same question (0)
  • Sukrut Parab Profile Picture
    71,710 Moderator on at

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

  • Verified answer
    Martin Dráb Profile Picture
    238,743 Most Valuable Professional on at

    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.

  • Suggested answer
    Andrew Xu Profile Picture
    3,877 on at

    here's a post with more details,

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

  • Rizwan Shahid Profile Picture
    15 on at

    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]
  • nmaenpaa Profile Picture
    101,166 Moderator on at

    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

    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,166 Moderator on at

    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?

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 > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans