Trying to post the packing slip with AIF service SalesSalesPackingSlipService (AX 2009). Following is the exception details and c# code that I am using.
Exception :
{“Request Failed. See the Exception Log for details.”}.
AX exception log:
Line=1, Pos=2241, Xpath=/SalesPackingSlip/SalesParmTable[1]/SalesParmLine[1]"
Quantity is 0 in the salesParmLine record on item
No lines for posting or quantity = 0
Posting has been canceled.
C# Code:
SalesPackingSlipServiceClient proxy = new SalesPackingSlipServiceClient();
AxdSalesPackingSlip salesPackingSlip = new AxdSalesPackingSlip();
AxdEntity_SalesParmTable salesParmTable = new AxdEntity_SalesParmTable();
salesParmTable.SalesId = “00381815”;
salesParmTable.CustAccount = custAccount;
salesParmTable.InvoiceAccount = invAccount;
salesParmTable.SalesName = soName;
AxdEntity_SalesParmLine salesParmLine = new AxdEntity_SalesParmLine();
salesParmLine.DeliverNow = 3;
salesParmLine.InventNow = 3;
salesParmLine.InventTransId = “6037127”;
salesParmLine.ItemId = “00021222”;
salesParmLine.CustAccount = custAccount;
salesParmLine.InvoiceAccount = invAccount;
salesParmLine.OrigSalesId = “00381815”;
salesParmLine.LineNum = 1;
salesParmTable.SalesParmLine = new AxdEntity_SalesParmLine[] {salesParmLine};
AxdEntity_SalesShippingStat salesShip = new AxdEntity_SalesShippingStat();
salesShip.Quantity = Convert.ToDecimal(1);
salesShip.SalesId = " 00021222";
salesParmTable.SalesShippingStat = new AxdEntity_SalesShippingStat[] {salesShip};
salesPackingSlip.SalesParmTable = new AxdEntity_SalesParmTable[] { salesParmTable };
AifSalesPackingSlipSvc.EntityKey[] returdedSalesPackingSlipEK = proxy.create(salesPackingSlip);
Any help would be greatly appreciated.