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
0
Answers
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
Claus
http://www.AcumenConsulting.co.nz
So better use FILTERGROUPS 6 and up.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
How can OnFindRecord / OnNextRecord trigger be used in this case?
Regards,
Anse
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
Claus
http://www.AcumenConsulting.co.nz
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,
Anse
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,
Anse
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.
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
Claus
http://www.AcumenConsulting.co.nz
Please try coding below, maybe can help you to solve the problems.
Good luck!
Thank you,
Kok 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,
Anse
I got your message with the info.
Thanks & Regards,
Anse
Access to the forums and thereby the two posts should be public now.
Regards
Claus
http://www.AcumenConsulting.co.nz