I want to show projects which have some specific permissions to the user which opening Projects list page.
I have written below code to calculate the permissions and store records in tempJob table.
what is the best way to apply those jobs from temporory variable to rec variable?
JobTMP.DELETEALL;
Job.RESET;
Job.SETFILTER(Blocked,'%1|%2',Job.Blocked::" ",Job.Blocked::Posting);
IF Job.FINDSET THEN
REPEAT
IF (Job."Person Responsible" = UserSetupRec."Resource Code") OR (Job."Project Manager" = UserSetupRec."Resource Code") THEN BEGIN
JobTMP := Job;
IF JobTMP.INSERT THEN
JobTMP.MODIFY;
END ELSE BEGIN
IF LimitProjectsandTasksLookup(UserSetupRec."Resource Code",Job."No.",'') THEN BEGIN
JobTMP := Job;
IF JobTMP.INSERT THEN
JobTMP.MODIFY;
END;
END;
UNTIL Job.NEXT = 0;
0
Answers
I am not sure this is the answwer you are looking for, but i would suggest, as an alternative, to apply the required permissions by modifying the OnFindRecord and OnNextRecord triggers on the page.
This is IMHO the more flexible way to apply more complex filters
See Page 7347 - Locations with Warehouse List as an example.
do you have any idea whether it works if users are working simultaneously without any error?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
I should admit that in my own scenarios the records involved are lower than 100 but I don't see why a higher number of records or a multiple simultaneous access should be a source of problems as we are just checking for each record whether it should be displayed or skipped when loading the page.
Hope this helps.
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Hi all,
A colleague of mine implemented this solution on a table with thousands of records and it's very very very slow when the end users run the page.
if it's slow then this is probably because you have to skip over many records in OnNextRecord. Implement some logic to circumvent this.
First set a filter as good as possible in Rec.
Then, if filter function (WMSMgt.LocationIsAllowed in the Page 7347 mentioned above) returns false, check if you can skip stretches of records, that will get rejected. E.g. you might want to use a second record with an different filter (same sort order though) and step through them alternatingly. You might even need a rec for a different Table for this.
How can we solve it?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
I somewhere read uzing security filters cause lot of problems?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav