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.
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.