
Hello community,
I need to call method when importing data entity, but I need to call it once before any record imported, the data entity EcoResProductMasterEntity .
I saw similar posts about sequence of call but could not find what is the method which is called only once before or after data entity is finished running:
All the methods within data entity are called for every row
.
what did I miss? Is this the case that there is not single method which is called when data entity is initialized just before importing starts.
OData and Data Management both needed to handle one extra line of code we need to add
Hi Volodymyr
I have had that requirement a few times. But if you think about it enough, it does not really make sense. The code on the DE is for a single DE record. It has no knowledge of the batch job. I usually end up throwing an error on initializeEntityDataSource() or insertEntityDataSource() if some conditions are not met. Which is usually not necessary as the table validateWrite or validateField will fail, causing the entity to throw an error with an appropriate message. Or I communicate the requirements for a successful import to the client very clearly.
That being said I remember that there was some sort of new method that you can override (or an attribute you need to specify) which will be called before a DMF job executes (still nothing for OData). But I was looking for it now and couldn't find anything. Maybe I was dreaming.