Report.RUN doesn't shoot, Report.RUNMODAL does

Hi there,

at first: I’m sure I know the differences between RUN and RUNMODAL - that’s NOT the question.

Today I experienced a funny phenomenon I want to share with you.

There’s a report as a batch function, starting a lookup form, after that form is closed with OK some processing is made (e.g. document release) and after that - still inside that initial report - I ask the user via CONFIRM if she/he wants to print a report.

Thing is that this does not start the report (screen is flickering instead):

IF CONFIRM(Text005, TRUE) THEN
// same result with: REPORT.RUN(50133, TRUE, FALSE, SH);
R50133.RUN;

… but this does:

F CONFIRM(Text005, TRUE) THEN
// same result with: REPORT.RUNMODAL(50133, TRUE, FALSE, SH);
R50133.RUNMODAL;

Why? I try to avoid the COMMIT before RUNMODAL.

Don’t bother about filtering the record SH, that’s OK. The debugger shows that not even the initial OnPreDataItem is started in the first case, just Codeunit 1’s FindPrinter.

This is in 3.70 hotfix 12 native.

Tom

Hi,

.RUN can’t be used in transaction, because it starts new instance.

.RUNMODAL - uses the same instance as caling code.

Lookups in Nav acts like transaction. Then closing lookup form, NAV tray to clear used resuorses, so all obj should be run on the same execution instance.