Create a custom lookup that limits miscellaneous work
completed items based on the rate template assigned to the SM Service Site.
The following is
just one example of how to write a custom lookup. If you use this lookup example, only
standard items with rates assigned in the rate template will display in the Standard Item drop-down when a
technician adds a miscellaneous work completed item to a scope.-
In the web portal, select .
-
In Select a Lookup, select
Add New Lookup.
-
In the SQL Choices Override
box, enter the following:
Note: Changes made on the Manage Lookups page
are saved automatically.
SELECT kSMStandardItem.SMStandardItemID ChoiceShortName
kSMStandardItem.[Description] ChoiceLongName
FROM kSMEntity
INNER JOIN kSMWorkOrderScope
ON kSMEntity.SMCo = kSMWorkOrderScope.SMCo
AND kSMWorkOrderScope.RateTemplate = kSMEntity.RateTemplate
INNER JOIN kSMRateOverrideStandardItem
ON kSMEntity.SMCo = kSMRateOverrideStandardItem.SMCo
AND kSMEntity.EntitySeq =
kSMRateOverrideStandardItem.EntitySeq
INNER JOIN kSMStandardItem
ON kSMRateOverrideStandardItem.SMCo = kSMStandardItem.SMCo
AND kSMRateOverrideStandardItem.StandardItem =
kSMStandardItem.StandardItem
INNER JOIN kSMRateTemplate
ON kSMWorkOrderScope.SMCo = kSMRateTemplate.SMCo
AND kSMWorkOrderScope.RateTemplate =
kSMRateTemplate.RateTemplate
WHERE kSMWorkOrderScope.SMWorkOrderScopeID = @SMWorkOrderScopeID
-
Select Evaluate
Lookup to test the new lookup.
If any errors are found, an error message will display at the bottom of the
page. If no errors are found, no messages will display.
-
Select the Active check box at the top
of the page.