for each row in Order
{
inventoryamt = Promotional_Item_Input[ID = row.ItEm].Quantity_In_Stock;
if(Order.Quantity > inventoryamt.toLong())
{
rec = Promotional_Item_Input[ID = input.Order.ItEm];
alert "There are only " + inventoryamt + " left of " + rec.Item + ". Please adjust your order quantity.";
cancel submit;
}
}