Hi I am creating an XML file that is posted via eConnect. It is all seemingly working except this validation error, and I can't really figure out why. Here is my code, this basically creates an xml file. I've tried all sorts of decimal places for unit cost. Have even created a record in dynamics, looked up DECPLCUR which is 9, and still it doesn't want to validate. What am I missing?
POPReceivingsType oPOPReceivingsType = new POPReceivingsType();
taPopRcptHdrInsert invoiceHeader = new taPopRcptHdrInsert();
taPopRcptLineInsert_ItemsTaPopRcptLineInsert line1=new taPopRcptLineInsert_ItemsTaPopRcptLineInsert();
taPopRcptLineInsert_ItemsTaPopRcptLineInsert line2 = new taPopRcptLineInsert_ItemsTaPopRcptLineInsert();
invoiceHeader.POPRCTNM = "R000094";
invoiceHeader.POPTYPE = 3; //Shipping/invoice
invoiceHeader.VNDDOCNM = "8751";
invoiceHeader.VENDORID = "LEAFRIVE0001";// "TAN002";
invoiceHeader.VENDNAME = "Leaf River Paging Systems";//Tank2Create";
invoiceHeader.CURNCYID = "GBP";
invoiceHeader.SUBTOTAL = Convert.ToDecimal(123.2);
invoiceHeader.TAXAMNT = Convert.ToDecimal(24.64);
invoiceHeader.TAXSCHID = "PSTD";
invoiceHeader.PYMTRMID = "30 Days";
invoiceHeader.receiptdate = DateTime.Now.ToString("dd/MM/yyyy");
oPOPReceivingsType.taPopRcptHdrInsert = invoiceHeader;
//add lines
line1.POPTYPE = 3;
line1.POPRCTNM = "R000094";
line1.CURNCYID = "GBP";
line1.NONINVEN = 1;
line1.ITEMNMBR = "LANYARDS x 30";
line1.ITEMDESC = "LANYARDS x 30";
line1.UOFM = "Each";
line1.QTYINVCD = 1;
line1.QTYSHPPD = 1;
line1.UNITCOST = Decimal.Parse("43.200000000");
line1.EXTDCOST = Decimal.Parse("43.200000000");
line1.UNITCOSTSpecified = true;
line1.RCPTLNNM = 1;
line1.VENDORID = "LEAFRIVE0001";
line1.LOCNCODE = "01-N";
line1.INVINDX = 1;
line2.POPTYPE = 3;
line2.POPRCTNM = "R000094";
line2.CURNCYID = "GBP";
line2.NONINVEN = 1;
line2.INVINDX = 2;
line2.ITEMNMBR = "A5 MEET THE TEAM INVITES";
line2.ITEMDESC = "A5 MEET THE TEAM INVITES";
line2.UOFM = "Each";
line2.QTYINVCD = 1;
line2.QTYSHPPD = 1;
line2.UNITCOST = Decimal.Parse("80.000000000");
line2.UNITCOSTSpecified = true;
line2.EXTDCOST = Decimal.Parse("80.000000000");
line2.RCPTLNNM = 2;
line2.VENDORID = "LEAFRIVE0001";
line2.LOCNCODE = "01-N";
oPOPReceivingsType.taPopRcptLineInsert_Items = new taPopRcptLineInsert_ItemsTaPopRcptLineInsert[2];
oPOPReceivingsType.taPopRcptLineInsert_Items[0] = line1;
oPOPReceivingsType.taPopRcptLineInsert_Items[1] = line2;
eConnectType eConnect = new eConnectType();
eConnect.POPReceivingsType = new POPReceivingsType[1];
eConnect.POPReceivingsType[0] = oPOPReceivingsType;
// Create a file to hold the serialized eConnect XML document
FileStream fs = new FileStream(filename, FileMode.Create);
XmlTextWriter writer = new XmlTextWriter(fs, new UTF8Encoding());
// Serialize the eConnect document object to the file using the XmlTextWriter.
XmlSerializer serializer = new XmlSerializer(eConnect.GetType());
serializer.Serialize(writer, eConnect);
writer.Close();