Subquery_error_In_Integration_Monitore :Subquery returned more than 1 value

Subquery_error_In_Integration_Monitore :Subquery returned more than 1 value

***** Internal to CitiXsys *******

Product Version: 

6.5 Update 6


You may come across the integration issue in iVend 6.5.6, where record stuck in integration monitor with below error. 


“System.Data.SqlClient.SqlException (0x80131904): Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1



Observations: 

In the above-listed sample screenshot, the record stuck above shows that it is a Transaction Type record . i.e. ( 143 Source Type).


Based on this you can use  Integration procedure Integration_Transaction to check its details using the transactionKey:

 

To Check the details execute the below Store procedure.

Exec Integration_Transaction 9000000000189266

 

Run below scripts to check the other details of the transaction :


Select HasSales,HasFulFillments,HasDeliveries,HasGiftCertificates,HasSaleExchanges,* from TrxTransaction where TransactionKey=9000000000189266.


Select HasFulfillment,HasSerialNumber,HasDiscounts,IsExchange,IsPromotionApplied,* from TrxTransactionSaleItem where TransactionKey=9000000000189266

 

Note: - Observe the above SQL Query result and do further investigation accordingly.

 

In this case, we observed that the value of the column “HasFulFillments” in table “trxtransaction” was as 1.


Thus, the transaction was related to fulfillment, so we checked the below-related tables of fulfillment. 


Select * from TrxTransactionFulfillment where TransactionKey=9000000000189266

Select * from TrxTransactionFulfillmentDetail where TransactionKey=9000000000189266


Note: If you will get more duplicate records of products with same product key and Qty with different key in the TrxTransactionFulfillmentDetail from below Script,then please confirm the duplicate record of product and take a backup of TrxTransactionFulfillmentDetail.


Select * from TrxTransactionFulfillmentDetail Where FulfillmentKey=9000000000202102


Backup Query: 

Select  *  into TrxTransactionFulfillmentDetail_bkp180320 from TrxTransactionFulfillmentDetail where FulfillmentKey =9000000000202102

 

Delete the duplicate records from TrxTransactionFulfillmentDetail  table by selecting concerned FulfillmentDetailKey :


Delete from TrxTransactionFulfillmentDetail where FulfillmentDetailKey='FulfillmentDetailKey need to be deleted'

 

Once done, retried the failed integration record and checked, it was successfully integrated from iVend to SAP.


Note: If we are facing this issue multiple times on iVend 6.5.6, we recommended please apply the latest patch.