I have a form that has several fields that update based on combo boxes. The first combo box uses @DbColumn to pull the first column in a view. The second combo box pulls the second column in the same view based on the the selection of the first combo box. That works fine. The issue is; I have several succeeding computed fields that use the selection from the second combo box to pull from the same view's, succeeding columns. Those computed fields are not working. I thought I could merely use an @DbLookup command in Javascript to call the values from the view but it is not working.
Here is the javascript code for the first combo box (pretty simple):
@DbColumn(@DbName(), "PLBV", 1)
Here is the second combo box code:
var vendor = getComponent("POVendor").getValue();
var items = @DbLookup(@DbName(), "PLBV", vendor, 2);
if (@IsError(items))
return "Please select a Vendor first";
else
return items;
Both of these routines work exactly as I want. Here is the issue. I have three more fields that should be populated based on the value of the second combobox. It doesn't work. I'll give you the code but it's really basic.
var item = document1.getItemValue("Item_1");
var cost = @DbLookup(@DbName(), "PLBV", item, 3);
return cost;
This code returns a blank value (nothing shows up in the field). What am I doing wrong?