OnQueryClosePage - Stop the page from closing

poppinspoppins Member Posts: 647
Hi everyone,

I've written some code in the OnQueryClosePage trigger of a page.

IF CloseAction IN [ACTION::OK,ACTION::LookupOK] THEN BEGIN
fctXXX();
Rec.NEXT;
END;

The code in fctXXX() is executed but the page closes anyway (whether there is a next record or not).
Is there a way to prevent the page from closing if there is a next record?

Thanks in advance :smile:

Answers

  • jglathejglathe Member Posts: 639
    Hi poppins,

    To stop the page from closing you need to return false. This should do the trick.

    with best regards

    Jens
  • poppinspoppins Member Posts: 647
    jglathe wrote: »
    Hi poppins,

    To stop the page from closing you need to return false. This should do the trick.

    with best regards

    Jens

    OK, but is it possible to move the page to the next record?
  • MichelDant77MichelDant77 Member Posts: 4
    In my case use the OnQueryClosePage event, to avoid closing the page.

    trigger OnQueryClosePage(CloseAction: Action): Boolean
    var
    ok: Boolean;
    begin
    if amount1 <> amount2 then
    ok := Confirm(ValidateAmountLbl, false);
    exit(ok);
    end;
Sign In or Register to comment.