Effect of Filtergroups

afrancis
Member Posts: 43
Hi,
While opening the job card, only the project manager of that job should be able to view the job records. Considering that the logged in user is the project manager (the check for which is made at the OnOpenForm), only the relevant job records for that project manager are filtered. But the user can override this by 'Show all'.
Following is the code at the OnOpenForm:
FILTERGROUP(2);
JobAdministrator.SETRANGE("Administrator ID",USERID);
IF JobAdministrator.FIND('-') THEN BEGIN
REPEAT
GET(JobAdministrator."Job No.");
MARK(TRUE);
UNTIL JobAdministrator.NEXT = 0;
MARKEDONLY(TRUE);
END;
FILTERGROUP(0);
The JobAdministrator table captures the User IDs of the persons responsible for the job(like the project manager etc). It contains the job no. & the administrator User ID.
The records are filtered correctly when the job card is opened. But if the user clicks 'Show all', then the effect is gone.
How can we disable the effect of 'show all' in this
situation?
Regards,
Anse
While opening the job card, only the project manager of that job should be able to view the job records. Considering that the logged in user is the project manager (the check for which is made at the OnOpenForm), only the relevant job records for that project manager are filtered. But the user can override this by 'Show all'.
Following is the code at the OnOpenForm:
FILTERGROUP(2);
JobAdministrator.SETRANGE("Administrator ID",USERID);
IF JobAdministrator.FIND('-') THEN BEGIN
REPEAT
GET(JobAdministrator."Job No.");
MARK(TRUE);
UNTIL JobAdministrator.NEXT = 0;
MARKEDONLY(TRUE);
END;
FILTERGROUP(0);
The JobAdministrator table captures the User IDs of the persons responsible for the job(like the project manager etc). It contains the job no. & the administrator User ID.
The records are filtered correctly when the job card is opened. But if the user clicks 'Show all', then the effect is gone.
How can we disable the effect of 'show all' in this
situation?
Regards,
Anse
0
Answers
-
Hi Anse
FILTERGROUP’s doesn’t work with the mark function, they only works with filters applied using SETRANGE, SETFILTER or SETRECFILTER (filters applied to fields). I am afraid you will have to find another way of solving your problem.
You could use the OnFindRecord and OnNextRecord trigger to hide the records. I believe there are posts in this forum describing how this can be achieved.
Regards
Claus0 -
And don't use FILTERGROUPS 1..5 because they are reserved by Navision.
So better use FILTERGROUPS 6 and up.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Hi Claus,
How can OnFindRecord / OnNextRecord trigger be used in this case?
Regards,
Anse0 -
Hi
You can find the answer her:
http://www.mbsonline.org/forum/topic.asp?TOPIC_ID=12946
http://www.mbsonline.org/forum/topic.asp?TOPIC_ID=15090
Regards
Claus0 -
Hi Claus,
I am not able to access these topics; access is restricted. I tried registering also, but they are not taking in new members.
Would appreciate if you could send the info. if possible.
Thanks & Regards,
Anse0 -
Hi Claus,
I am unable to access these topics; access is restricted. I tried registering also, but they are not accepting new users.
Would appreciate if you could send in the info.
Thanks & Regards,
Anse0 -
Best thing in your case is to use OnNextRecords and OnFindRecord indeed.
Basically you need to put code in the OnNextRecords, and OnFindRecord triggers of the form.
OnNext basically says what to do when you do a next (Up/Down) on the form, in your case if the next record does not meet your requirements, then do another next.
OnFind is when you do a find on a form,. that could be Ctrl F, or Page Down etc. In this case, you tell the form the record was not found unless it fits your criteria.0 -
Hi Afrancis
I thought the forums on mbsonline.org were accessible. I have just asked one of the old mbsonline.org moderators if they can open the closed forums. I will get back to you later.
Regards
Claus0 -
Hi Anse,
Please try coding below, maybe can help you to solve the problems.Form - OnAfterGetCurrRecord() MARKEDONLY(TRUE);
Good luck!
Thank you,
Kok Keong0 -
Hi Keong,
Excellent! That worked.
Claus, I would still like to get the info. on OnNextRecord & OnFindRecord if possible.
Thanks a lot for all your inputs.
Regards,
Anse0 -
Hi Claus,
I got your message with the info.
Thanks & Regards,
Anse0 -
Hi Afrancis
Access to the forums and thereby the two posts should be public now.
Regards
Claus0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions