Mousewheel - Bug?!

vocvoc Member Posts: 11
edited 2008-09-29 in Navision Attain
In the OnAfterGetRecord of the "Employee Card" I prompt a message if some fields are not filled and i go back to xRec so that the user has to fill out these fields.
If I use PageUp or PageDown it works fine. But if I change the record by scrolling with the mousewheel I get the message more often the faster I scroll...
If i start the Debugger and scroll fast, he only fires the AfterGetRecord - Trigger once. Is this an unsolvable bug or is there may a solution?!

Regards Claus

Comments

  • kapamaroukapamarou Member Posts: 1,152
    Have you tried to put your code in OnAfterGetCurrRecord??? Probably the wheel usage jumps more records than just one...

    If there is no code in that trigger the debugger won't stop there...
  • vocvoc Member Posts: 11
    yeah i tried... but does not change anything
  • kapamaroukapamarou Member Posts: 1,152
    I have done something similar for my development but I used ERROR instead of MESSAGE. Would that help??? The Error will cause it to stop... If the code is only on the OnAfterGetCurrRecord it works for me...
  • vocvoc Member Posts: 11
    no, that doesn't help, 'cause error closes the form and the form shouldn't be closed, 'cause the user first has to fill the required fields...
  • kapamaroukapamarou Member Posts: 1,152
    I went back to see my code...

    I actually don't use ERROR... (Nice memory...). I perform some checks and if they fail I do a
    SETPOSITIO(xRec.GETPOSITION) to take the user back to the record he was viewing...
  • vocvoc Member Posts: 11
    hm, thanks for the answer, but doesn't make any changes
  • SavatageSavatage Member Posts: 7,142
    can you explain more the code you're using for "Mandatory Fields"
  • garakgarak Member Posts: 3,263
    Do you need the message only when the user change some defined field values or ever when he browse trough the recs (mouse wheel, is the same like PG UP / Down).
    If 1. then don't use the OnAfterGetRecord trigger for this, if second i find this ](*,) because ever a message pops up.

    Regards
    Do you make it right, it works too!
  • garakgarak Member Posts: 3,263
    if you need this only after a modification use these triggers on form:
    Form - OnNextRecord(Steps : Integer) : Integer
    IF NOT CheckVatRegNo THEN
      EXIT(0);
    
    EXIT(NEXT(Steps));
    
    
    Form - OnAfterGetRecord()
    ...
    RecIsModified := FALSE;
    
    
    Form - OnModifyRecord() : Boolean
    RecIsModified := TRUE; //"Gen. Bus. Posting Group" <> xRec."Gen. Bus. Posting Group";
    EXIT(TRUE);
    
    
    Form - OnQueryCloseForm() : Boolean
    EXIT(CheckVatRegNo);
    
    
    CheckVatRegNo() : Boolean
    IF RecIsModified THEN BEGIN
      IF (Condition) THEN BEGIN
        IF NOT CONFIRM('Ignore that a the FIELD has not the correct value',FALSE) THEN
          EXIT(TRUE);
    
        CurrForm."SomeField".ACTIVATE;
        EXIT(FALSE);
      END;
    END;
    EXIT(TRUE);
    

    So the confirm is only displayed when a rec (here the field in the condition) is modified and it will displayed when the user wil close the form or step to a next / new record.

    Regards
    Do you make it right, it works too!
Sign In or Register to comment.