Limit Jobs That can be Viewed to Logged-In User's Roles

Create a lookup to limit the jobs that display based on the logged-in user's roles.

The logged-in user must have a VA User Profile (Viewpoint Administration > Programs > VA User Profile) that includes the following setup:
  • On the Info tab, a Payroll company (PR Co) and employee number (Employee field) must be assigned.
  • On the Roles tab, the user must have a role assigned.
The following setup applies to your portal only, not to Vista.
  1. In Vista, select User Database > Programs > UD User Defined Lookups.
    1. On the Info tab, enter udJobRoles.
    2. Give the lookup a Title. For example, Job Based on Roles.

    3. In FromClause, enter JCJM.
    4. For the Where Clause, enter the following:
      JCJM.JCCo = ? and JCJM.JobStatus = 1 and DDUP.PRCo = ? and DDUP.Employee = ?
    5. For the Join Clause, enter the following:
      INNER JOIN JCJobRoles on JCJM.JCCo = JCJobRoles.JCCo and JCJM.Job = JCJobRoles.Job
      INNER JOIN DDUP on JCJobRoles.VPUserName = DDUP.VPUserName
    6. In Order by column, enter 0.
    7. Select the Details tab.

    8. Add a JCJM.Job column:
      • ColumnName = JCJM.Job
      • ColumnHeading = Job
      • Datatype = bJob
    9. Add a JCJM.Description column:
      • ColumnName = JCJM.Description
      • ColumnHeadING = Description
      • InputType = bDesc
    10. Save your changes.
  2. In Vista, add the custom lookup to the Job field in PR Timecard Entry.

    1. Select Payroll > Programs > PR Timecard Entry.
    2. Select an existing batch, or open a new one.
    3. On the Info tab, select the Job field, and press F3 to open field properties.
    4. In the Field Seq# drop-down, select 20 - Job.
    5. On the Lookups tab, add the udJobRoles field.
    6. In the Parameters field, enter 19,-2,-3.
    7. Set the Load Seq # to 0, and leave the Active check box unmarked.
    8. Save your changes.
For more information on setting up lookups in Vista, see Creating a Custom Lookup in Vista Help.