Purchase Order related queries, topics and discussions
User avatar
By Kuldar
#710 I get fatal error 457 "This key is already associated with an element of this collection" when I send more than 2 products in XML message. It does not matter what are the products. Also this only happens with client machine but not with my internal testing machine.
Do you have any ideas how could I solve this? :?:

Message example that i send:
<msg:msg xsi:schemaLocation="http://Epicor.com/InternalMessage/1.1 http://scshost/schemas/Epicor/ScaInternalMsg.xsd" xmlns:msg="http://Epicor.com/InternalMessage/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<msg:req tag="Purchase Order In">
<msg:dta>
<dta:PurchaseOrder xsi:schemaLocation="http://www.scala.net/PurchaseOrder/1.1 http://scshost/schemas/Scala/1.1/PurchaseOrder.xsd" xmlns:dta="http://www.scala.net/PurchaseOrder/1.1">
<dta:OrderHeader>
<dta:PurchOrdNum/>
<dta:OrdType>1</dta:OrdType>
<dta:SuppCode>2199</dta:SuppCode>
<dta:Purchaser>EXW</dta:Purchaser>
<dta:ShipAddrNum/>
<dta:Warehouse>22</dta:Warehouse>
<dta:DelivDate>2018-01-25</dta:DelivDate>
<dta:OrgDelivDate>2018-01-25</dta:OrgDelivDate>
</dta:OrderHeader>
<dta:OrderLines>
<dta:OrderLine>
<dta:StockCode>AF100</dta:StockCode>
<dta:QtyOrdered>11</dta:QtyOrdered>
</dta:OrderLine>
<dta:OrderLine>
<dta:StockCode>BM50/28</dta:StockCode>
<dta:QtyOrdered>14</dta:QtyOrdered>
</dta:OrderLine>
<dta:OrderLine>
<dta:StockCode>CPB100</dta:StockCode>
<dta:QtyOrdered>6</dta:QtyOrdered>
</dta:OrderLine>
<dta:OrderLine>
<dta:StockCode>CPC100</dta:StockCode>
<dta:QtyOrdered>9</dta:QtyOrdered>
</dta:OrderLine>
<dta:OrderLine>
<dta:StockCode>CPD100</dta:StockCode>
<dta:QtyOrdered>8</dta:QtyOrdered>
</dta:OrderLine>
<dta:OrderLine>
<dta:StockCode>FB100/39</dta:StockCode>
<dta:QtyOrdered>21</dta:QtyOrdered>
</dta:OrderLine>
<dta:OrderLine>
<dta:StockCode>FB50/39</dta:StockCode>
<dta:QtyOrdered>14</dta:QtyOrdered>
</dta:OrderLine>
<dta:OrderLine>
<dta:StockCode>PUM75</dta:StockCode>
<dta:QtyOrdered>4</dta:QtyOrdered>
</dta:OrderLine>
<dta:OrderLine>
<dta:StockCode>SB70</dta:StockCode>
<dta:QtyOrdered>19</dta:QtyOrdered>
</dta:OrderLine>
</dta:OrderLines>
</dta:PurchaseOrder>
</msg:dta>
<msg:ctx>
<SrvLocation/>
<UserName>AutoOT</UserName>
<UserPwd>dsdsfdsgfg</UserPwd>
<CompanyCode>EE</CompanyCode>
<FiscalYear>2018</FiscalYear>
<ResubmitWaitTime>20</ResubmitWaitTime>
<ResubmitWaitTime>20</ResubmitWaitTime>
<Options>
<AllowOrderAdd>1</AllowOrderAdd>
<AllowLinesChange>0</AllowLinesChange>
<AllowLinesDelete>0</AllowLinesDelete>
<Counter>K</Counter>
<AllowNegativeQuantity>1</AllowNegativeQuantity>
<AllowNegativePrice>0</AllowNegativePrice>
<OrderTypeRule>1</OrderTypeRule>
<ContractSearch>0</ContractSearch>
<AllowAdjustingIndividualTextLines>0</AllowAdjustingIndividualTextLines>
</Options>
</msg:ctx>
</msg:req>
</msg:msg>


Message that I receive from manager:
<?xml version="1.0" encoding="utf-16"?>
<msg:Msg xsi:schemaLocation="http://Epicor.com/Message/2.0 http://scshost/schemas/epicor/ScalaMessage.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:msg="http://Epicor.com/Message/2.0">
<msg:Hdr>
<msg:Logon>
<msg:Usr>AutoOT</msg:Usr>
<msg:Pwd>:E:EAAAAHXW5lc+hmQMQDRlGiUNzZ0=
</msg:Pwd>
<msg:CompCode>EE</msg:CompCode>
<msg:FiscalYear>2018</msg:FiscalYear>
</msg:Logon>
</msg:Hdr>
<msg:Body>
<msg:Req msg-type="" action="">
<msg:Dta>
<dta:PurchaseOrder xsi:schemaLocation="http://www.scala.net/PurchaseOrder/1.1 http://scshost/schemas/Scala/1.1/PurchaseOrder.xsd" xmlns:msg="http://Epicor.com/InternalMessage/1.1" xmlns:dta="http://www.scala.net/PurchaseOrder/1.1">
<dta:OrderHeader>
<dta:PurchOrdNum/>
<dta:OrdType>1</dta:OrdType>
<dta:SuppCode>2199</dta:SuppCode>
<dta:Purchaser>EXW</dta:Purchaser>
<dta:ShipAddrNum/>
<dta:Warehouse>22</dta:Warehouse>
<dta:DelivDate>2018-01-25</dta:DelivDate>
<dta:OrgDelivDate>2018-01-25</dta:OrgDelivDate>
</dta:OrderHeader>
<dta:OrderLines>
<dta:OrderLine>
<dta:StockCode>AF100</dta:StockCode>
<dta:QtyOrdered>11</dta:QtyOrdered>
</dta:OrderLine>
<dta:OrderLine>
<dta:StockCode>BM50/28</dta:StockCode>
<dta:QtyOrdered>14</dta:QtyOrdered>
</dta:OrderLine>
<dta:OrderLine>
<dta:StockCode>CPB100</dta:StockCode>
<dta:QtyOrdered>6</dta:QtyOrdered>
</dta:OrderLine>
<dta:OrderLine>
<dta:StockCode>CPC100</dta:StockCode>
<dta:QtyOrdered>9</dta:QtyOrdered>
</dta:OrderLine>
<dta:OrderLine>
<dta:StockCode>CPD100</dta:StockCode>
<dta:QtyOrdered>8</dta:QtyOrdered>
</dta:OrderLine>
<dta:OrderLine>
<dta:StockCode>FB100/39</dta:StockCode>
<dta:QtyOrdered>21</dta:QtyOrdered>
</dta:OrderLine>
<dta:OrderLine>
<dta:StockCode>FB50/39</dta:StockCode>
<dta:QtyOrdered>14</dta:QtyOrdered>
</dta:OrderLine>
<dta:OrderLine>
<dta:StockCode>PUM75</dta:StockCode>
<dta:QtyOrdered>4</dta:QtyOrdered>
</dta:OrderLine>
<dta:OrderLine>
<dta:StockCode>SB70</dta:StockCode>
<dta:QtyOrdered>19</dta:QtyOrdered>
</dta:OrderLine>
</dta:OrderLines>
</dta:PurchaseOrder>
</msg:Dta>
<msg:Errs>
<msg:Err type="fatal error">
<msg:Num>457</msg:Num>
<msg:Descr>This key is already associated with an element of this collection</msg:Descr>
<msg:Src>ScaBPCOrder</msg:Src>
</msg:Err>
<msg:Err type="fatal error">
<msg:Num>457</msg:Num>
<msg:Descr>This key is already associated with an element of this collection</msg:Descr>
<msg:Src>ScaBPCOrder.boPCOrder.ImportLines</msg:Src>
</msg:Err>
<msg:Err type="fatal error">
<msg:Num>457</msg:Num>
<msg:Descr>This key is already associated with an element of this collection</msg:Descr>
<msg:Src>ScaBPCOrder.boPCOrder.ImportOrder</msg:Src>
</msg:Err>
<msg:Err type="fatal error">
<msg:Num>457</msg:Num>
<msg:Descr>This key is already associated with an element of this collection</msg:Descr>
<msg:Src>ScaWPCPurchOrderIn.PCPurchOrderIn.ParseOrder</msg:Src>
</msg:Err>
<msg:Err type="fatal error">
<msg:Num>457</msg:Num>
<msg:Descr>This key is already associated with an element of this collection</msg:Descr>
<msg:Src>ScaWPCPurchOrderIn.PCPurchOrderIn.ProcessRequest</msg:Src>
</msg:Err>
</msg:Errs>
</msg:Req>
</msg:Body>
</msg:Msg>


Thank you!