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

Post load method in Data entity

(2) ShareShare
ReportReport
Posted on by 1,327
Dear team,
 
I explored in Google and found that in "Post load" method not recommended to write code while exporting or importing data entity. It caused the performance issue.
 
Kindly elaborate please is it correct?
 
I have few queries:
 
1. When we think about to write code in Post Load method. I mean in which scenario.
 
2. Is there any alternative solution? I mean instead of writing code in Post load method.
 
Kindly elaborate please.
 
Thanks in advance
Categories:
I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    305,155 Super User 2026 Season 1 on at
    Hi,
     
    There is an alternative possible to use virtual columns where you can use T-SQL which is performing better. In case of a low number of records expected, you can use the postload() method. The postload() wiill cause a row-by-row processing instead of set-based processing. This method is causing delays often perceived as performance issue.
  • CU05031448-0 Profile Picture
    1,327 on at
    Thanks Andre for to the reply.
     
    I have one query -
     
    1. Is Post load method is calling for each record?
    Suppose I have 5000 records and I wrote code in Post load method during Import. So, is this method is getting called 5000 times?
     
    2. For the huge data , shall I go always with Virtual columns instead of writing code in Post load method.
     
    Kindly elaborate please.
     
    Thanks in advance.
  • Martin Dráb Profile Picture
    239,634 Most Valuable Professional on at
    postLoad() is called when a record is loaded from database, therefore yes, if you load 5000 records, postLoad() will be called 5000 times.
     
    The correct names are virtual fields (that's when you use postLoad() to populate the field) and computed columns. Computed columns are better, but harder to write and you sometimes want to use existing X++ logic that can't easily be rewritten to X++, or at all. Therefore it's good to always consider computed columns first, but you may find that a virtual field is a much easier solution or even the only one.
     
    Note that it's not just about the number of records, but also about what the calculation logic does. For example, if you need to make two DB queries and you're loading 5000 records, you'll add extra 10000 requests to database.
  • Sagar121 Profile Picture
    1,185 Super User 2026 Season 1 on at
    Hi,
     
    Can you please anwser if entity is standard or custom?
     
    Please tell business use case based on that we will able to suggest alternative methods.
     
    Thanks

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 797

#2
André Arnaud de Calavon Profile Picture

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

#3
Subra Profile Picture

Subra 534

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans