Few issues with fetch. I've gotten too complicated I think.
Form A records a product description, barcode, price at time of capture and the store it was purchased at. Store Name is a lookup field, then two single line fields and a currency field.
Form B is a stateless form that when a barcode is scanned checks to see if a record exists. If so, it displays the highest price recorded, lowest price recorded and product description.
I want to add in a fetch for the store where the lowest price was last recorded, as well as a fetch for the store that most often has the item at the lowest price.
Toying around I have gotten fetch for a store name to work but it returns the ID. I can't for the life of me figure out how to place the appropriate code to show the value.
Below is my current code:
if(Add_an_Item[Scan_a_Barcode_Add == input.Barcode_Check].count() == 0)
{
hide Highest_Price_Check;
hide Lowest_Price_Check;
hide Product_Description_Check;
alert " Product not Found, Please add Item.";
}
else
{
show Highest_Price_Check;
show Lowest_Price_Check;
show Product_Description_Check;
fet = Add_an_Item[Scan_a_Barcode_Add == input.Barcode_Check].Price_Add.getAll();
fet.sort();
input.Lowest_Price_Check = fet.get(0);
input.Highest_Price_Check = fet.get(fet.size() - 1);
input.Product_Description_Check = Add_an_Item[Scan_a_Barcode_Add == input.Barcode_Check].Product_Description_Add;
input.Store_Name_Check = Add_an_Item[Scan_a_Barcode_Add == input.Barcode_Check].Store_Name_Add;
}