Options

Order Control

cwatrelotcwatrelot Member Posts: 14
edited 2000-10-19 in Navision Financials
We want to display a confirm message to the user if the current order as not been printed (or other similar checking) like :

if [leave current order] and ("# printed" = 0) then
if not confirm('The order %1 had never been printed, continue ?') then
Don't move !

And to stay on the current order without confirmation.
This test must be done if the form is closed, or if another order is finded (with the 'previous' icon for example), but is not required if the user is only switching between header and lines.
We are trying every table and form triggers but can't find the fine way to achieved this goal.
Any idea ?

Comments

  • Options
    rmotzerrmotzer Member Posts: 11
    Try this:

    First: Create an error in OnQueryCloseForm, if the required action is missing. This way the user is not able to close the form without an entry.

    Second: In the Trigger OnAfterGetRecord you insert some code that checks if the xRec is o.K.. If it's not - you jump back to the xRec and tell the user what's missing.

    in OnQueryCloseForm ...
    IF "myCondition" = TRUE THEN
    ERROR('...');

    in OnAfterGetRecord ...
    IF ("Nr." <> xRec."Nr.") AND (xRec."Nr." <> '') THEN BEGIN
    IF ("myCondition" in xRec!) = TRUE THEN BEGIN
    Rec := xRec;
    xRec.TRANSFERFIELDS(Rec);
    CurrForm.UPDATE(FALSE);
    MESSAGE('Please ...');
    END;
    END;

    Greetings, Richard
Sign In or Register to comment.