PR Craft Template Overrides Lookup for Timecard Entry
If you use craft templates that have overrides applied to them, follow the steps below to configure your craft lookup to respect this logic.
This logic will only be applied if craft is a column shown on the timecard. This article will guide you through the process of creating a user defined lookup in Vista, applying the lookup to Vista's PR Timecard Entry, and configuring the Portal to inherit the lookup.
Lookup
- From
- PRCM with (nolock)
- Where
-
PRCM.PRCo = ? and PREH.PRCo = PRCM.PRCo
and PREH.Employee = ?
and 1 = CASE WHEN ? is null Then 1
WHEN JCJM.Job is null Then 1
When ? is not null and JCJM.Job = ? and PRCM.Craft is not null then 1
Else 0 END
-
- Join
-
LEFT OUTER JOIN JCCO on PRCM.PRCo = JCCO.PRCo
LEFT OUTER JOIN JCJM on JCCO.JCCo = JCJM.JCCo
LEFT OUTER JOIN PRCT on PRCM.PRCo = PRCT.PRCo and PRCM.Craft = PRCT.Craft and PRCT.RecipOpt = 'O' and JCJM.CraftTemplate = PRCT.Template
LEFT OUTER JOIN PRCM JCraft on PRCT.PRCo = JCraft.PRCo and PRCT.JobCraft =JCraft.Craft
OUTER APPLY PREH
-
- Details
- ISNULL(PRCT.JobCraft, PRCM.Craft)
- CASE WHEN PRCT.JobCraft is not null then JCraft.[Description] Else PRCM.[Description] END
- ROW_NUMBER() OVER (ORDER BY CAST(CASE WHEN PREH.Craft = PRCM.Craft Then 1 Else 0 END as varchar(1)) desc, RIGHT(' ' + ISNULL(PRCT.JobCraft, PRCM.Craft),10) asc)
- Group By
- ISNULL(PRCT.JobCraft, PRCM.Craft), CASE WHEN PRCT.JobCraft is not null then JCraft.[Description] Else PRCM.[Description] END
- , RIGHT(' ' + ISNULL(PRCT.JobCraft, PRCM.Craft),10), CASE WHEN PREH.Craft = PRCM.Craft Then 1 Else 0 END
Apply the Lookup in Timecard Entry
- Open PR Timecard Entry.
- Select the Craft Field and press F3.
- Select the Lookups tab.
- Enter in the name of the Lookup made in the above step.
- Enter in the parameters -1,10,20,20,20 .
- Set the Load Sequence to 0.
- Change any other load sequences on the form to a number greater than 0.
- Select OK.
Portal Setup
- Navigate to .
- Go to the Craft row. In the New Line Behavior column for
Craft, select Blank
.
-
Select Advanced to open the Craft Advanced Settings, then check Auto Select 1st. This auto-selection only applies if the lookup returns a single value.
- Go to the Job row. Select Advanced to open the Job
Advanced Settings. Add Craft to the list of Dependent Fields.Note: Use a comma to separate entries in Dependent Fields.