In the past, up to and including Navision 2015, I have had reports that did some pre-processing in Temporary Tables.
This included lines like TempResults.DELETEALL(FALSE);
And it was never an issue before.
Now suddenly in NAV2017 it is a problem because when I call the DELETEALL, the system automatically tries to delete records (even though there is none) from Table 1550 - "Restricted Record". The problem is one is not allowed modify the database with this report.
Changing the Transaction type property of the entire report from "Browse" to "Update" or "UpdateNoLocks" makes the problem go away of course, as now I am allowing the report to be modifying the real database.
But I would like to know why this is happening, can it be stopped, or are my only options to change the report?
OR would it be ok to change the Navision standard code line that does a DELETEALL(TRUE) on Table 1550 to IF NOT ISEMPTY THEN DELETEALL(TRUE) so the new code never actually runs?
What is this new trigger? Where is it being triggered in the first place? And is it another "bug" that MS are allowing it to be triggered on Temporary Table Variables? It looks like a feature that only makes any sense on REAL tables, not temporary ones.
0
Answers
If I understand you, I believe that the "DELETE" is triggered by some events.
If my assumption is correct, check if you have an event subscriber to OnAfterDelete or OnbeforeDelete of your table "Results". If any, try to add this code in the subscriber function.
If Rec.ISEMPTY THEN
EXIT;
Here is an example based on table 38
Also, double check that your "TempResults" is a temp table.