000312 : ConnectIt-Sage200 - cannot insert duplicate key row in object |
article type: |
HTML |
created: |
13 Nov 2014 |
last updated: |
07 Oct 2015 |
|
search again |
|
|
message
|
Cannot insert duplicate key row in object ‘dbo.SOPOrderReturn’ with unique index ‘IX_SOPOrderReturn_DocumentTypeID_DocumentNo’. The duplicate key value is (0, ). The statement has been terminated. |
|
|
cause
|
When ConnectIt creates a Document in Sage through the Sage 200 API a placeholder record is created in the Sage database. This placeholder doesn't have a Document Number (DocumentNo) assigned initially - it gets applied when the record is committed to the database fully. If ConnectIt was committing a Document to the database (perhaps a no Stock error or Customer Account on hold message - something ConnectIt doesn’t validate for directly but which Sage 200 would have raised a valid, meaningful message for as a prompt to the User) and the User cancelled the process, then potentially this placeholder could be left in the database. If the User had terminated ConnectIt at that time (rather than just clicking ok) then potentially ConnectIt wouldn't have disconnected with the Sage 200 API gracefully and so the placeholder record could have been left. It is this Document Number-less record than is now causing the ‘duplicate key row...’ error as ConnectIt (via the Sage 200 API) tries to create another Document Number-less placeholder record for the next Document the User tries to create. |
|
resolution
|
Use the ConnectIt Configuration | Advanced tab | Tools tab | Delete Document feature with ‘Sales Order’ selected in the dropdown to remove the placeholder record. |
|
|
|
|
|
search again |
see also...
|
|