In my continued tour of the world of Epicor 10 Customizations, I came across what I am finding to me quite a puzzler. Below is a snippet of a customization that calls the CustShipAdapter, which works splendidly.
Dim adpPackLines As CustShipAdapter = New CustShipAdapter(oTrans)
adpPackLines.BOConnect()
Dim csaQueryHead As String = String.Format("PackNum = '{0}'", ei.strPackNum)
Dim csaOpts As Ice.Lib.Searches.SearchOptions = New Ice.Lib.Searches.SearchOptions(Ice.Lib.Searches.SearchMode.AutoSearch)
csaOpts.DataSetMode = Ice.Lib.Searches.DataSetMode.RowsDataSet
csaOpts.PreLoadSearchFilter = csaQueryHead
adpPackLines.InvokeSearch(csaOpts)
Dim dsPackLines As Erp.BO.CustShipDataSet = adpPackLines.CustShipData
Now here is another code snippet that calls the SalesOrderAdapter, and this does not work.
Dim objOrderHed As SalesOrderAdapter = New SalesOrderAdapter(oTrans)
objOrderHed.BOConnect()
Dim objQueryHead As String = String.Format("OrderNum = '{0}'", ei.intOrderNum)
Dim objOpts As Ice.Lib.Searches.SearchOptions = New Ice.Lib.Searches.SearchOptions(Ice.Lib.Searches.SearchMode.AutoSearch)
objOpts.DataSetMode = Ice.Lib.Searches.DataSetMode.RowsDataSet
objOpts.PreLoadSearchFilter = objQueryHead
objOrderHed.InvokeSearch(objOpts)
Dim dsOrder As Erp.BO.SalesOrderDataSet = objOrderHed.SalesOrderData
To make things really easy to compare, I made each snippet to be 8 lines long, with line X on each snippet doing the same thing for the adapter itâs working with.
As far as I know, I have all of the appropriate assemblies loaded, but for some reason when I try to compile the 2nd snippet (the one for the SalesOrderAdapter) I get the following error:
Error: BC31429 - line 217 (509) - âsalesOrderDataâ is ambiguous because multiple kinds of members with this name exist in class âErp.Adapters.SalesOrderAdapterâ.
Line 217 is this:
Dim dsOrder As Erp.BO.SalesOrderDataSet = objOrderHed.SalesOrderData
Poking around in the source code for both Erp.Adapters.CustShip.dll as well as Erp.Adapters.SalesOrder.dll and they both have 2 methods that are named the same, but with different signatures. Both are shown below.
What is throwing me for a loop is why I am getting the error for the SalesOrderData and not for CustShipData.
Anyone have any thoughts?