I am attempting to pull in the on hand quantity for a part using the PartBinSearchAdapter. Using the BL tester and inputing parameters a row is returned. When I use the code below no row is returned. Any ideas why I would not get data when I do in the BL Tester using the exact parameters as are passed in the code?
Dim JobMtl As EpidataView = Ctype(oTrans.EpiDataViews("JobMtl"),EpiDataView)
Dim lotNum As String = EpiTextBoxC1.Text
Dim partNum As String = JobMtl.dataView(JobMtl.Row)("partNum")
Dim PartBinAdapt As PartBinSearchAdapter = New PartBinSearchAdapter([RQForm])
PartBinAdapt.BOConnect()
Dim PartBin As Erp.BO.PartBinSearchDataSet = PartBinAdapt.GetPartBinByLot(partNum, lotNum)
OHQty = PartBinAdapt.PartBinSearchData.Tables("PartBinSearch").Rows(0)("QtyOnHand")
PartBinAdapt.Dispose()
Having banged my head on the wall with similar specialized methods in adapters, I feel your pain.
Usually after I’ve wasted an hour, I give up and resort to GetRows/GetList using a where clause.
Also I see you are passing the form in to the constructor of PartBinSearch adapter. Can you do that? I am used to passing the oTrans.
Oh I think I see the issue. You are placing the result of GetPartBinByLot to a DataSet (called PartBin) but then you are trying to pull the results from the built-in dataset in the adapter.
Try changing:
OHQty = PartBinAdapt.PartBinSearchData.Tables("PartBinSearch").Rows(0)("QtyOnHand")
to
OHQty = PartBin.Tables("PartBinSearch").Rows(0)("QtyOnHand")