Hi,
I was using Dynamics GP 10.0, and have two companies. One is TEST company, and another one is LIVE PRODUCTION company. We're implementing eConnect now and decide to test it on TEST company.
This is eConnect code we use to create a sales order in the Dynamics GP.
using (eConnectMethods eConnectMethods = new eConnectMethods()) { taSopLineIvcInsert_ItemsTaSopLineIvcInsert[] LineItems = new taSopLineIvcInsert_ItemsTaSopLineIvcInsert[lstItemsDet.Count]; SOPTransactionType salesOrder = new SOPTransactionType(); taSopHdrIvcInsert salesHdr = new taSopHdrIvcInsert(); int lineItemCount = 0; foreach (var item in lstItemsDet) { taSopLineIvcInsert_ItemsTaSopLineIvcInsert salesLine = new taSopLineIvcInsert_ItemsTaSopLineIvcInsert(); salesLine.CUSTNMBR = CustomerID; salesLine.SOPTYPE = 2; salesLine.DOCID = DocID; salesLine.QUANTITY = item.Quantity; salesLine.ITEMNMBR = item.ItemNo; salesLine.UNITPRCE = item.UnitPrice; salesLine.XTNDPRCE = item.UnitPrice * item.Quantity; salesLine.DOCDATE = System.DateTime.Today.ToString("MM/dd/yyyy"); salesLine.LOCNCODE = DefSiteID; salesLine.SOPNUMBE = NextSoNumber; LineItems[lineItemCount] = salesLine; lineItemCount++; } salesHdr.CUSTNMBR = CustomerID; salesHdr.SOPTYPE = 2; salesHdr.DOCID = DocID; salesHdr.BACHNUMB = BatchID; salesHdr.DOCDATE = System.DateTime.Today.ToString("MM/dd/yyyy"); salesHdr.LOCNCODE = DefSiteID; salesHdr.SUBTOTAL = amount; salesHdr.DOCAMNT = amount; salesHdr.SOPNUMBE = NextSoNumber; salesHdr.PRSTADCD = PrimaryShipTo; salesHdr.USINGHEADERLEVELTAXES = 0; salesOrder.taSopHdrIvcInsert = salesHdr; salesOrder.taSopLineIvcInsert_Items = LineItems; eConnectType eConnect = new eConnectType(); SOPTransactionType[] MySopTransactionType = new SOPTransactionType[1] { salesOrder }; eConnect.SOPTransactionType = MySopTransactionType; // Serialize the master vendor type in memory. MemoryStream memoryStream = new MemoryStream(); XmlSerializer xmlSerializer = new XmlSerializer(eConnect.GetType()); // Serialize the eConnectType. xmlSerializer.Serialize(memoryStream, eConnect); // Reset the position of the memory stream to the start. memoryStream.Position = 0; // Create an XmlDocument from the serialized eConnectType in memory. XmlDocument xmlDocument = new XmlDocument(); xmlDocument.Load(memoryStream); memoryStream.Close(); // Call eConnect to process the XmlDocument. eConnectMethods.eConnect_EntryPoint(connectionString, EnumTypes.ConnectionStringType.SqlClient, xmlDocument.OuterXml, EnumTypes.SchemaValidationType.None, string.Empty); }
I know it'll work and create a sales order, but in which company it'll create it? This should not create on the LIVE PRODUCTION COMPANY.
How to find what company it will take or how to change the default company on eConnect?
P.S: I got an error "This company does not have access to this Currency ID or is Inactive". I enabled currency IDs only for the test company and disabled for the live production company. Since the error clearly states, I am afraid, it is linking with live company and not with the production company. How can I change it test company?
Thanks in advance.
*This post is locked for comments