Posts

Showing posts from February, 2024

Data Entity add computed field

Image
 We have this product import module that has a lot of entities, the main identifier or product number is store in one table. The references to that product is through a GUID. In one of the entitties I need to add a computed field for export. The fastest way to do this is to add a computed string value. One could think that adding some postLoad logic would do the trick, but this field will then not be exported through Data management, only visible in OData. I've added these two fields: EPDNr is not a computed field but populated in the postLoad method with this syntax: public void postLoad() {      EPDProduktDto produktDto;           super(); select firstonly EPDNr        from produktDto           where produktDto.ProduktGUID == this.ProduktGUID;           this.EPDNr = produktDto.EPDNr; } EPDNrComputedField is as you might have guessed a computed field. Populated on the server with the method below, please do notice that the values are not in quotations, looks like server a