Notifications
Announcements
No record found.
PostLoad
MapdatasourceToEntity
MapEntityToDataSource
PostTargetProcess
For each method above
1. Which one is used for import and which one is used for export. also could one of them be used in both import and export?
2. Can someone give me a simple/clear real example on when to use each one? I want a real scenario so that I can differenceate when to use each one and to know why this method only will work in this scenario and why other methods won't work.
"Data source" means tables. Map entity to data source means mapping entity to the actual table, i.e. import. The other way is export.
"Staging to target" is also about moving data from entities to F&O tables (import).
Hi Martin
1. So "MapEntityToDataSource" and "postTargetProcess" are used for Import. But what's the difference between both? And when should I use each one? Is there a real example?
2. MapDataSourceToEntity is for export...but when should I use this method..in what cases?
3. postLoad..is it for export or impot? And when should I use it?
map* methods are used for mapping data fields between an entity record and particular table records. E.g. when you want to say that field A of the entity should be transformed and written to field B of table T1.
postTargetProcess() executes after everything was written to tables.
postLoad() is called when a record is loaded from database. In case of entities, you read data when you want to export it.
The standard application is full of real examples. You can also use a search engine to find more information about these methods, such as blog posts. An example about postTargetProcess(): AX 7. Process the data after Data Entity import.
Hey Martin,
1. Is Table T1 inside the entity?
So let's say the entity has two tables
T1 and T2
You want the value of field A in T2 to be updated with field B in T2?
But now what's the difference between updateEntityDataSource and MapEntityToDataSource?
2. If postload is used for export, then when to use MapDataSource to entity and when to use postLoad.. what's the difference?
1. updateEntityDataSource() is called when a table is being updated, but not when a new record is inserted. mapEntityToDataSource() is called before both of them and therefore the mapping applies to both inserts and updates.
2. Use mapDataSourceToEntity() in all cases except of populating a virtual field. If you're interested in virtual fields, you'll find more details (including sample code) in F&O documentation.
So it's either I put the logic twice in updateEntityDataSource and InsertEntityDataSource OR I put the logic in MapEntityToDatasource?
So they are used for the same thing?
Duplicating the same logic in both methods would be a design flaw.
mapEntityToDatasource() is the right method for this purpose.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 611 Most Valuable Professional
André Arnaud de Cal... 529 Super User 2025 Season 2
Sohaib Cheema 285 User Group Leader