Hi, as we all know Record Security Level is not an option for non-SQL Navision. I need to limit a user XXX to view all payroll records. So I have implemented that in the Employee Form: OnOpenForm() FILTERGROUP (4); IF USERID = ‘XXX’ THEN SETCURRENTKEY (“Payroll Group No.”); SETRANGE(“Payroll Group No.”, ‘YYY’); FILTERGROUP (0); However, user XXX still can access Employee records via different Reports. How do I stop her from doing that? We have quit a few Payroll reports in our Navision 3.01 Thank you for your advise.
Hi Denis One option could be add a field to the Table 91 “User Setup” eg “Payroll Group No. Filter” Text 500, and add the restricted filters there Then on the reports and forms you can set your filters as such. UserSetup.GET(USERID); … SETFILTER(“Payroll Group No.”,UserSetup.“Payroll Group No. Filter”); … And by using ‘IF’ statements they can be used as exceptions to normal filtering. I hope this is of some help.
Another way to set record level permissions is Employee.SETPERMISSIONFILTER placed at OnPreDataItem trigger. Of Course it works only with SQL database.
Hi Denis not sure, but you can look into “security Filter” option in the permissions for a role. regds MK
MK, that’s the probelm with non-SQL Navision - security Filter option does NOT work. Does anyone know an easy solution other than coding reports, forms, etc? Correction to my code from above: IF USERID = ‘XXX’ THEN BEGIN FILTERGROUP (4); SETCURRENTKEY (“Payroll Group No.”); SETRANGE(“Payroll Group No.”, ‘YYY’); FILTERGROUP (0) END;
I solved that by adding a field in the Table 243 ‘Security Filter’ and some code in the CodeUnit 310 : IF 243.“Security Filter”=‘Employee’ then begin Employee.SETRANGE(“Payroll Group No.”, ‘YYY’); REPORT.RUNMODAL(“Report ID”,Employee,ShowRequestForm); end; So every report that have been set to “Security Filter” = ‘Employee’ would be launched with the filter YYY set. The prob is that the Zup doesn’t save any more the other filters you had set