Restricting employee from seeing one dept

Sort:
You are not authorized to post a reply.
Author
Messages
psherry
Basic Member
Posts: 6
Basic Member
    The payroll manager wants her payroll clerks to see all employees except for employees with their departments. On example is I built a security class for Pay Modeling, so they have access to PR89.1. I wrote a conditional rule on the table Employee stating if table.department == 4710 no access else all access and that works on the selects but they can still enter the employee in the emp-employee field on the form. I been trying to write a conditional rule on the form to restrict employees in 4710 but can't get anything to work. I thought I could use the getDBfield but I can still enter an employee from dept 4710 in the emp-employee field. Any recommendations on how I could get this restricted on the form? Thanks, Paul
    John Henley
    Senior Member
    Posts: 3348
    Senior Member
      Rules written against tables only apply to drill-arounds and selects. So, when you write "I wrote a conditional rule on the table Employee", that is why it's working on the drop-down list. What you would next need to do is write a rule against PR89.1 itself, which compares the user's Department (using getDBField) against the Department (again using getDBField) for form.EMP_COMPANY / form.EMP_EMPLOYEE. Something like this: if(getDBField('EMPLOYEE','DEPARTMENT',form.EMP_COMPANY,form.EMP_EMPLOYEE)== getDBField('EMPLOYEE','DEPARTMENT',user.getCompany(),user.getEmployeeId())) 'NO_ACCESS,' else 'ALL_ACCESS,'
      Thanks for using the LawsonGuru.com forums!
      John
      lwoods@phs.org
      New Member
      Posts: 1
      New Member
        We use a 'PLDeptPayGrade' element: strToNum(DEPARTMENT)!=9320&&strToNum(DEPARTMENT)!=9422&&strToNum(DEPARTMENT)!=9430&&strToNum(DEPARTMENT)!=9438&&strToNum(DEPARTMENT)!=9442&&strToNum(DEPARTMENT)!=9443&&strToNum(DEPARTMENT)!=9444&&strToNum(DEPARTMENT)!=9445&&strToNum(DEPARTMENT)!=9446&&strToNum(PAY_GRADE)<90 This element is then attached to the HR Table Security Classes. We keep our Table security classes seperate from those Functional. We do not have MSS up yet, but are hoping MSS Security Class will allow us to have HR Managers override this to see their own employees.
        psherry
        Basic Member
        Posts: 6
        Basic Member
          Thanks for the replies, John yours worked perfect!!!
          You are not authorized to post a reply.