Adding a lookup
Lookups enable users to select a list of options rather than typing in data.
The following figure shows the available lookup icons and the fields associated with them.

The Presentation Framework supports the following types of lookups:
- Single Field Lookup - Enables a user to search an entity for a specific value, select that value, and insert it into the appropriate single input field. Use the callLookup() JavaScript function. See "callLookup."
- Calendar Lookup - Enables a user to select a date from a pop-up calendar. Use the invokeCalendar() JavaScript function. See "invokeCalendar".
If you need a multiple field lookup, you can use the yfcShowSearchPopup() JavaScript function. This example shows product class, item ID, and unit of measure to be populated from an item lookup using the yfcShowSearchPopup() JavaScript function.
//this function should be called from “onclick” event of the icon next to
//item id field.
function callItemLookup(sItemID,sProductClass,sUOM,entityname)
{
var oItemID = document.all(sItemID);
var oProductClass = document.all(sProductClass);
var oUOM = document.all(sUOM);
showItemLookupPopup(oItemID, oProductClass, oUOM, entityname);
}
function showItemLookupPopup(itemIDInput, pcInput, uomInput, entityname)
{
var oObj = new Object();
oObj.field1 = itemIDInput;
oObj.field2 = pcInput;
oObj.field3 = uomInput;
yfcShowSearchPopup('','itemlookup',900,550,oObj,entityname);
}
And in the lookup list view, call the following function to populate the field from which the pop-up was invoked:
function setItemLookupValue(sItemID,sProductClass,sUOM)
{
var Obj = window.dialogArguments
if(Obj != null)
{
Obj.field1.value = sItemID;
Obj.field2.value = sProductClass;
Obj.field3.value = sUOM;
}
window.close();
}
Use Lookup icons only with modifiable fields. When you incorporate a particular type of Lookup on field, place the appropriate icon directly to the right of the Lookup.