Quantcast
Channel: Sage 100
Viewing all articles
Browse latest Browse all 36990

Forum Post: Looking up value in Item Cos

$
0
0
I need to look up an item while entering a sales order and determine whether there are any FIFO tiers over 90 days old.  So far I've been able to use the .movefirst and .movenext methods to accomplish this, but I performance is poor.  Is there a way to jump to a particular point in the data (by item code?). oItemCost = oSession.GetObject("IM_ItemCost_bus") Set oItemCost = oSession.AsObject(oItemCost) oItemCost.MoveFirst() Do until cBool(oItemCost.Eof) or Found = 1 Do While strItemNo = strItemNoCheck strFifoDate = "" Qty = 0 strItemNoCheck = "" strWHSCode = "" strTierType = "" retVal = oItemCost.GetKey("ItemCode$", strKey) retVal = oItemCost.GetValue("ItemCode$", strItemNoCheck) retVal = oItemCost.GetValue("WarehouseCode$", strWHSCode) retVal = oItemCost.GetValue("TierType$", strTierType) retval = oItemCost.GetValue("ReceiptDate$", strFifoDate) retval = oItemCost.GetValue("QuantityOnHand", Qty) 'set flag indicating that item FIFO tiers were found Found = 1 strday = right(strFifoDate,2) strmonth = mid(strFifoDate,5,2) stryear = left(strFifoDate,4) strFifoDate = strmonth & "/" & strday & "/" & stryear DaysDiff = DateDiff("d",strFifoDate,Now()) if DaysDiff 90 and Qty 0 and trim(strTierType) = "1" then strTierInfo = "There are " & formatnumber(Qty) & " of item # " & strItemNo & " in warehouse " & strWHSCode & " received on " & strFifoDate & " (" & formatnumber(DaysDiff) & " days old). " & vbCrLf & strTierInfo End If oItemCost.MoveNext() Loop oItemCost.MoveNext() Loop if trim(strTierInfo) "" then oSession.AsObject(oSession.UI).MessageBox(trim(strTierInfo)) End If

Viewing all articles
Browse latest Browse all 36990

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>