When I run a form triger OnFindRecord is started. when the user press keys Shift+Ctrl+F7 or button which clear a filters triger OnFindRecord strated again. how I determined when is pressed toolbar for clear filters
Afaik, this is not possible, I'm afraid.
The pointer doesn't leave the record, because the record is still displayed. That's why no trigger is "fired".
IF Users.GET(USERID) THEN BEGIN
CASE Users."Job Type" OF
Users."Job Type"::Salesperson : BEGIN
RESET;
SETRANGE("Salesperson Code",Users."Person Code");
RecordFind:=FINDFIRST;
CurrForm.EDITABLE:=TRUE;
EXIT(RecordFind);
END;
Users."Job Type"::Speditor,Users."Job Type"::SeniorSpeditor : BEGIN
RESET;
SETRANGE("Senior Speditor",Users."Person Code");
RecordFind:=FINDFIRST;
CurrForm.EDITABLE:=TRUE;
EXIT(RecordFind);
END;
END;
END;
this triger is execute one way started the form and second when user press key Shift+Ctrl+F7
Comments
The pointer doesn't leave the record, because the record is still displayed. That's why no trigger is "fired".
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
add you code onaftergetrecord to compare the filters to rec and if they are different, you know that the user has changed the filters.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Form_OnFindRecord()
EXIT(SetFilterPerUser);
Form_OnAfterGetRecord
......
SetFilterPerUser() : Boolean
IF Users.GET(USERID) THEN BEGIN
CASE Users."Job Type" OF
Users."Job Type"::Salesperson : BEGIN
RESET;
SETRANGE("Salesperson Code",Users."Person Code");
RecordFind:=FINDFIRST;
CurrForm.EDITABLE:=TRUE;
EXIT(RecordFind);
END;
Users."Job Type"::Speditor,Users."Job Type"::SeniorSpeditor : BEGIN
RESET;
SETRANGE("Senior Speditor",Users."Person Code");
RecordFind:=FINDFIRST;
CurrForm.EDITABLE:=TRUE;
EXIT(RecordFind);
END;
END;
END;
this triger is execute one way started the form and second when user press key Shift+Ctrl+F7
FILTERGROUP := 2;
set filters ....
FILTERGROUP := 0;