Hi,
So I managed to get a working eConnect solution in dev, have deployed to live and am getting the following validation error:
eCONNECT VALIDATION ERROR: Microsoft.Dynamics.GP.eConnect.eConnectException: Sql procedure error codes returned:
Error Number = 4612 Stored Procedure= taPopRcptLineInsert Error Description = Invalid Account Index
Node Identifier Parameters: taPopRcptLineInsert
POPTYPE = 3
POPRCTNM = R000033
ITEMNMBR = Laynards x 30
Related Error Code Parameters for Node : taPopRcptLineInsert
INVINDX = Note: This parameter was not passed in, no value for the parameter will be returned.
<taPopRcptLineInsert>
<POPTYPE>3</POPTYPE>
<POPRCTNM>R000033</POPRCTNM>
<ITEMNMBR>Item x 30</ITEMNMBR>
<ITEMDESC>Item x 30</ITEMDESC>
<VENDORID>TAN002</VENDORID>
<RCPTLNNM>1</RCPTLNNM>
<UOFM>Each</UOFM>
<UNITCOST>43.20</UNITCOST>
<EXTDCOST>86.40</EXTDCOST>
<NONINVEN>1</NONINVEN>
<QTYSHPPD>2</QTYSHPPD>
<QTYINVCD>2</QTYINVCD>
<Purchase_IV_Item_Taxable>3</Purchase_IV_Item_Taxable>
<LOCNCODE>NO PROJECT</LOCNCODE>
<CURNCYID>GBP</CURNCYID>
</taPopRcptLineInsert>
at Microsoft.Dynamics.GP.eConnect.eConnectMethods.CreateEntity(String ConnectionString, String sXML)
at RemoteServerTest.Program.PostXMLToDynamics()
Ihave attempted to add the INVINDX to the eConnect object, but for some reason this parameter does not serialise
My C# is
[code]
//Invoice Header Details
invoiceHeader.POPRCTNM = invoice.SupplierDocumentNumber; //receipt number placeholder
invoiceHeader.POPTYPE = 3; //Shipping/invoice
invoiceHeader.VNDDOCNM = invoice.InvoiceNumber; //invoice number
invoiceHeader.CURNCYID = "GBP"; //currency defaults to GBP
invoiceHeader.TAXSCHID = invoice.TaxSchedule; //Tax Code
invoiceHeader.receiptdate = invoice.InvoiceDate.ToString("dd/MM/yyyy");
invoiceHeader.USINGHEADERLEVELTAXES = 2;
invoiceHeader.AUTOCOST = 1;
invoiceHeader.BACHNUMB = batchNumberPlaceHolder;
oPOPReceivingsType.taPopRcptHdrInsert = invoiceHeader;
//Invoice lines
oPOPReceivingsType.taPopRcptLineInsert_Items = new taPopRcptLineInsert_ItemsTaPopRcptLineInsert[invoice.InvoiceLines.Count];
foreach (OutgoingInvoiceLine line in invoice.InvoiceLines)
{
taPopRcptLineInsert_ItemsTaPopRcptLineInsert ecLine = new taPopRcptLineInsert_ItemsTaPopRcptLineInsert();
ecLine.POPRCTNM = invoice.SupplierDocumentNumber;
ecLine.VENDORID = vendorReference;
ecLine.CURNCYID = "GBP";
ecLine.ITEMNMBR = line.ItemDescription;
ecLine.ITEMDESC = line.ItemDescription;
ecLine.UOFM = "Each";
ecLine.QTYINVCD = line.Quantity;
ecLine.QTYSHPPD = line.Quantity;
ecLine.UNITCOST = Decimal.Parse(line.UnitCost.ToString());
ecLine.EXTDCOST = Decimal.Parse(Convert.ToString(line.UnitCost * line.Quantity));
ecLine.Purchase_IV_Item_Taxable = 3;
ecLine.EXTDCOSTSpecified = true;
ecLine.UNITCOSTSpecified = true;
ecLine.NONINVEN = 1;
ecLine.LOCNCODE = "NO PROJECT"; //default Location Code
ecLine.RCPTLNNM = lineNumber;
ecLine.POPTYPE = 3;
ecLine.INVINDX = 0;
oPOPReceivingsType.taPopRcptLineInsert_Items[lineIndex] = ecLine;
totalTax += line.UnitCost * line.Quantity;
lineIndex++;
lineNumber++;
}
//Invoice Tax
invoiceTax.TAXTYPE = 0;
invoiceTax.POPRCTNM = invoice.SupplierDocumentNumber;
invoiceTax.VENDORID = vendorReference;
invoiceTax.TAXDTLID = invoice.TaxDetail;
invoiceTax.TAXAMNT = totalTax;
invoiceTax.MSCTXAMT = Decimal.Parse("0.00");
invoiceTax.FRTTXAMT = Decimal.Parse("0.00");
oPOPReceivingsType.taPopRcptLineTaxInsert_Items = new taPopRcptLineTaxInsert_ItemsTaPopRcptLineTaxInsert[] { invoiceTax };
[/code]
Having a look around I suspect this is a GL Account set up issue (difference between the databases) - but I can't actually see where I would set this within the XML