Run a report on the result of another report

Hi everyone,

I am trying to run two report successively.
The first one will run on a set of records (based on a filter defined by user) and do several modifications to the records
The second report will run on the same set of records, but it must be on the modified records, not the original ones.
I wrote the following code:

function1(Rec1);
Rec2.COPY(Rec1);
function2(Rec2);

function1 will pass some parametres to the first report and then run it (same for function2).
Both function1 and function2 have the property VAR for their parameters.

but this didn’t work :(
How shall I proceed?

Thanks in advance :mrgreen:

Assuming that you of course actively did a MODIFY to the record in the first report after changing it (and not assuming that would be enough), then my suggestion is that you use the debugger, and put a watch on the record variables.

Then you can see when the value changes back to the old value.

If the secord report is feed with the correct value, then does it use it does it read it again like all other reports?

If that’s the case, then you could use a commit after the first report has run. That would commit that data into the database, allowing the report to read and use the new data. But remember if you use a commit, then the changes done by the first report, would still be committed, if the second report fails. So you need to consider this before doing it, that way.

try the SELECTLATESTVERSION and see if that helps