prakash
(JPN)
April 12, 2017, 6:08pm
1
Hi All,
At first I am invoking OrderAlloc.GetListOfOrders() method and returning ListTableset.
Secondly, I am invoking OrderAlloc.OrderAllocationGetRows(ListTableset, 0) method;
Invoking GetListOfOrders returns data. But invoking OrderAllocationGetRows not returning any data.
@joerojas already made numerous query on this, but could not find the relevant answers on this forum…
Any suggestions?
//Code is here
string ordHed = “OrderHed.OrderNum = 123”;
string orderDtl = "OrderDtl.OrderLine = 1 ";
string ordeRel = “OrderRel.OrderRelNum = 1”;
bool res;
Erp.Tablesets.OrderAllocTableset oat = new Erp.Tablesets.OrderAllocTableset();
Erp.Tablesets.OrderAllocListTableset oatl = new Erp.Tablesets.OrderAllocListTableset();
Erp.Contracts.OrderAllocSvcContract oa = null;
oa = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.OrderAllocSvcContract>(Db);
oatl = oa.GetListOfOrders("", ordHed, orderDtl, ordeRel, “”, “”, “”, “”, “”, “”, “”, “”, 0, 0, out res, callContextClient.CurrentCompany);
oat = oa.OrderAllocationGetRows(oatl, 0); // data exist in oatl, but not returning in oat
prakash
(JPN)
April 13, 2017, 9:51am
2
Hi @josecgomez , i see you have been through to this issue on your previous post.
if time permits, can you please shed some knowledge on this subject?
cheers mate…
Thanks Erik, I did find the helper class, my issue with the WTF haha was that in this particular service I was using (server side) using the TableSets, there was one method that was using DataSets... I was confused as to why. This is all server...
prakash
(JPN)
April 13, 2017, 10:53am
3
@josecgomez used one of your tool dotPeek to dig in OrderAllocationGetRows method. Below is the code. it does returns the OrderAlloc dataset, but he dataset is Empty…
Could you please give any pointers in getting the OrderAlloc dataset corectly…
public OrderAllocDataSet OrderAllocationGetRows(OrderAllocListDataSet ds, int ipLastDisplaySeq)
{
this.HandleContractInitCall(true);
if (DataTracer.TraceVerbose)
{
this.AddTraceParam("ds", "Erp.BO.OrderAllocListDataSet", "", (object) ds.Copy());
this.AddTraceParam("ipLastDisplaySeq", "System.Int32", "", (object) ipLastDisplaySeq);
}
OrderAllocDataSet orderAllocDataSet = new OrderAllocDataSet();
OrderAllocListTableset ds1 = new OrderAllocListTableset();
DatasetAdapter.CopyDataTableToTSTable<Erp.Tablesets.OrderAllocListRow>((DataTable) ds.OrderAllocList, (IceTable<Erp.Tablesets.OrderAllocListRow>) ds1.OrderAllocList, false);
for (this.RetryCount = this.OperationRetryCount; this.RetryCount >= 0; this.RetryCount = this.HandlePrepareForRetry())
{
try
{
OrderAllocTableset rows = this.HandleContractBeforeCall().OrderAllocationGetRows(ds1, ipLastDisplaySeq);
if (this.HandleContractAfterCall(true))
{
if (rows != null)
{
DatasetAdapter.CopyTSTableToDataTable<Erp.Tablesets.OrderAllocRow, OrderAllocDataSet.OrderAllocDataTable>((IceTable<Erp.Tablesets.OrderAllocRow>) rows.OrderAlloc, orderAllocDataSet.OrderAlloc);
DatasetAdapter.CopyTSTableToDataTable<Erp.Tablesets.OrderAllocSupplyRow, OrderAllocDataSet.OrderAllocSupplyDataTable>((IceTable<Erp.Tablesets.OrderAllocSupplyRow>) rows.OrderAllocSupply, orderAllocDataSet.OrderAllocSupply);
DatasetAdapter.CopyTSTableToDataTable<Erp.Tablesets.PartAllocRow, OrderAllocDataSet.PartAllocDataTable>((IceTable<Erp.Tablesets.PartAllocRow>) rows.PartAlloc, orderAllocDataSet.PartAlloc);
DatasetAdapter.CopyTSTableToDataTable<Erp.Tablesets.PartAllocLotRow, OrderAllocDataSet.PartAllocLotDataTable>((IceTable<Erp.Tablesets.PartAllocLotRow>) rows.PartAllocLot, orderAllocDataSet.PartAllocLot);
DatasetAdapter.CopyTSTableToDataTable<Erp.Tablesets.PartAllocSerialRow, OrderAllocDataSet.PartAllocSerialDataTable>((IceTable<Erp.Tablesets.PartAllocSerialRow>) rows.PartAllocSerial, orderAllocDataSet.PartAllocSerial);
DatasetAdapter.CopyTSTableToDataTable<Erp.Tablesets.PartAllocTranRow, OrderAllocDataSet.PartAllocTranDataTable>((IceTable<Erp.Tablesets.PartAllocTranRow>) rows.PartAllocTran, orderAllocDataSet.PartAllocTran);
}
if (DataTracer.TraceVerbose)
{
if (DataTracer.ReturnDataVerbose)
{
this.AddTraceReturnValue("returnDS", "Erp.BO.OrderAllocDataSet", "", (object) orderAllocDataSet.Copy());
this.AddTraceReturnValue("ds", "Erp.Tablesets.OrderAllocListTableset", "out", (object) ds.Copy());
break;
}
break;
}
break;
}
}
catch (Exception ex)
{
if (this.ShouldRethrowNonRetryableException(ex, (DataSet) ds))
throw;
}
finally
{
this.HandleContractFinally("OrderAllocationGetRows", "Erp.Tablesets.OrderAllocTableset", true);
}
}
return orderAllocDataSet;
}
prakash
(JPN)
April 13, 2017, 12:19pm
4
update… client side customisation works. if i do the same customisation in server side, OrderAllocationGetRows not working.,…
Erp.Proxy.BO.OrderAllocImpl oa = WCFServiceSupport.CreateImpl<Erp.Proxy.BO.OrderAllocImpl>(((Ice.Core.Session)oTrans.Session), Epicor.ServiceModel.Channels.ImplBase<Erp.Contracts.OrderAllocSvcContract>.UriPath);
Erp.BO.OrderAllocListDataSet oatl_r = new Erp.BO.OrderAllocListDataSet();
Erp.BO.OrderAllocDataSet oat_r = new Erp.BO.OrderAllocDataSet();
oatl_r = oa.GetListOfOrders("", ordnum, orderline, orderel, "", "", "", "", "", "", "", "", 0, 0, out flag, "");
oat_r = oa.OrderAllocationGetRows(oatl_r, 0);
if(oat_r.OrderAlloc.Rows.Count > 0)
{
MessageBox.Show("data exist");
}
Bart_Elia
(Bart Elia)
April 13, 2017, 2:14pm
5
You found a good one. I owe you a beer - wait dangerous precedence - beer as a bug bounty, scratch that…
string ordHed = “OrderHed.OrderNum = 5398”;
string orderDtl = "OrderDtl.OrderLine = 1 ";
string ordeRel = “OrderRel.OrderRelNum = 1”;
bool res;
Erp.Tablesets.OrderAllocTableset oat = new Erp.Tablesets.OrderAllocTableset();
Erp.Tablesets.OrderAllocListTableset oatl = new Erp.Tablesets.OrderAllocListTableset();
Erp.Contracts.OrderAllocSvcContract oa = null;
oa = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.OrderAllocSvcContract>(Db);
oatl = oa.GetListOfOrders("", ordHed, orderDtl, ordeRel, "", "", "", "", "", "", "", "", 0, 0, out res, Session.CompanyID);
//RowMod not initialized - researching
//So Workaround...
foreach (var row in oatl.OrderAllocList)
{
row.RowMod = IceRow.ROWSTATE_UNCHANGED;
}
oat = oa.OrderAllocationGetRows(oatl, 0);
//Populated now
I need to find out why RowMod is null on the original ‘Get’. This skips the assumed logic state in OrderAllocationGetRows so nothing is populated. When it is called from the client, the morphing of the row from tableset to dataset and back initializes the RowMod from null to string.Empty. I hate side effects
I’ll get a bug entered and you should have a valid workaround…
Thanks!
1 Like
prakash
(JPN)
April 13, 2017, 3:25pm
6
Thanks a lot for your time mate @Bart_Elia . was scratching my head for the last 48 hours… about to go with client side code, but you made my day better.
1 Like