D365FO Electronic Reporting (GER): Properly use table methods

Did you know that in the ER model mapping, when we use a table method like in the next picture:

It will execute the salesTable() method 3 times per each record? I know, it might not sound so dramatic, but when instead of just making a find we are executing other logic, and we call it from a lot of records… the performance can be seriously affected.

Easy solution, use a Calculated Field instead.

Therefore, with the configuration we have above, and with an export of 2 sales lines, we are going to call the salesTable() method 6 times. If we just create a CalculatedField and we call it directly like in the screenshot below (if you don’t know how, or you just don’t believe me, just see the video):

We will just call it 2 times, one per each record. Make sure you save your reused methods into Calculated fields so your Electronic Reporting does not make extra not needed calls. Hope you liked it, thanks!


Leave a comment