Problem with CustShip Adapter

The information come from of MaterialQueue. these product It was picked and I need to create a Custship whit the order picked

You then have to load up the data object with that information.

Hi, I find this method with parameters in the TRACE, but Ican´t find the adapter of PickedOrdersImpl.
With this method i can set the dataset to method —> adapterCustShip.PrePickedOrders(ds, out vMessage);

tracePacket>
businessObject>Erp.Proxy.BO.PickedOrdersImpl
methodName>GetRows
appServerUri>net.tcp://epr-01/E10Pilot/
returnType>Erp.Tablesets.PickedOrdersTableset
localTime>22/11/2018 09:18:10:9434175 a. m.
threadID>1
executionTime total=“468” roundTrip=“413” channel=“27” bpm=“0” other=“28” />
retries>0
parameters>
parameter name=“whereClausePickedOrders” type=“System.String”>
parameter name=“whereClauseMtlQueue” type=“System.String”>
parameter name=“pageSize” type=“System.Int32”>
parameter name=“absolutePage” type=“System.Int32”>
parameter name=“morePages” type=“System.Boolean”>
parameters>
/tracePacket>

This is de code… the error is when I try to set the dataset -----> CustShipPickedOrdersDataSet ds = adapterPickedOrders.GetRows(optsTrans,out more) as CustShipPickedOrdersDataSet;

ERROR accessing the database: Incorrect syntax near the keyword ‘AS’.

						 PickedOrdersAdapter adapterPickedOrders = new PickedOrdersAdapter(this.oTrans);
						adapterPickedOrders.BOConnect();
						bool more;
						SearchOptions optsTrans = new SearchOptions(SearchMode.AutoSearch); 
						optsTrans.PageSize = 0; 
						string whereTrans = string.Format("(OrderNum = " + orderNum.ToString()+ " and Company='"+ company +"' BY PartNum"); 
						optsTrans.NamedSearch.WhereClauses.Add("PickedOrders",whereTrans); 

						CustShipPickedOrdersDataSet ds = adapterPickedOrders.GetRows(optsTrans,out more) as CustShipPickedOrdersDataSet;					

						adapterCustShip.PrePickedOrders(ds, out vMessage);

I dont know much about picked orders, but I can tell you that this particular GetRows you reference, returns a PickedOrdersDataSet, not a CustShipPickedOrdersDataSet. Maybe it’s a simple as casting it. You could look to see if those two datasets align by looking at their defs in a decompiler.

try this

CustShipPickedOrdersDataSet ds = (CustShipPickedOrdersDataSet)adapterPickedOrders.GetRows(optsTrans,out more);

If the cast doesnt work like that but the datasets align (same tables/fields), you can potentially import rows from the result of your GetRows into a CustShipPickedOrdersDataSet. Probably the best way to find the ‘correct’ way is to have a look at the code of the form you are using to see how Epicor handles it.