Trigger events after importing from excel

1
Hi, we use the excel importing module to fill some tables in our database. This is working fine. But one of the fields in the tabel (entity) Patient should be filled with the year of birth. This value is substracted from the orginal field DayOfBirth in the the entity Patient. Is it possible to trigger an event during the import so that the field YearOfBirth is filled after the import of a Patient row. If I understand it well the following link https://community.mendix.com/questions/1476/After-Create-event-not-triggered-when-using-excel-importer describes such a scenario. However I don't understand what is meant by Excel Row and how to accomplice this. Is ExcelRow and example of should it be an entity of the Excel Import domain? Can someone help me to solve this in some way?
asked
5 answers
2

Yes it is true that events won't be triggered when you are using the excel importer. The same applies to database replication and xml mapping(modeler) or any custom Java action that uses Batches to process the imported objects.
Batches are created whit the purpose to process objects as fast as possible, this is achieved by caching the objects and storing them with a single sql query. Speaking for the excel importer and db replication: All data is being cached, during the import the actual entity is never available. So when the objects are created or stored there is no entity, no entity information, therefore the entity events are unknown and can't be executed.

You've already found the workaround, it is explained in the link you provided in your commend (see below), maybe or R&D department will make it possible to execute events while still using an create or change batch. But for now the only solution is using the workaround below....
https://forum.mendix.com/questions/1476/After-Create-event-not-triggered-when-using-excel-importer

answered
1

Or run a microflow after import that does the trick. The link from Jasper requires in-depth Mendix knowledge.

answered
0

Create a before commit event in the entity that does the calculation when YearOfBirth is empty. Hoping that the excelimporter triggers that event.

answered
0

You can use a virtual attribute to calculate the yearofbirth from existing attributes

(it doesn't seem completely clear from your question where this value comes from. Is the dayofbirth something you can use to calculate the yearofbirth or does yearofbirth come from somewhere else?)

answered
0

Thanks all,

to clearify. YearOfBirth is also an attribute of the Patient-entity. This entity contains an attribute DateOfBirth AND YearOfBirth (which is extracted from the DateOfBirth entity).

@Chris, Can you explain in more detail what you mean. I have a Microflow which will fill the attribute YearOfBirth and it is working fine. But I have to trigger it manually. I'm just looking for a way to execute it automatically.

answered