Create a custom lookup that limits material work completed
items and on-hand quantities based on the inventory location.
The following is just one example of how to write a
custom lookup. If you use this lookup example, only the material items located at the
selected inventory location, and their on-hand quantities at that location, will display
in the Material dropdown when
a technician adds an inventory 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
Cast(kHQMT.KeyID as varchar(20)) as ChoiceShortName,
Cast(kINMT.Material as varchar(20)) + ' - '+ kHQMT.Description + ' ( '+format(kINMT.OnHand,'N0') +' )' as ChoiceLongName
From kHQMT
JOIN kINMT ON kINMT.MatlGroup = kHQMT.MatlGroup AND kINMT.Material = kHQMT.Material and kINMT.Active = 'Y'
JOIN kINLM ON kINMT.INCo = kINLM.INCo AND kINMT.Loc = kINLM.Loc
Where kINLM.KeyID=@INLMKeyID
- 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.