During EndOfDay the error message"Violation of PRIMARY KEY constraint'PK_RtlStoreData_1'is displayed

During EndOfDay the error message"Violation of PRIMARY KEY constraint'PK_RtlStoreData_1'is displayed

Environment:

iVend 6.5 Update 6  


Problem Statement:

At the time of End of day below message appear


“Violation of PRIMARY KEY constraint 'PK_RtlStoreData_1'. Cannot insert duplicate key in object 'dbo.RtlStoreData'.” 


Proposed Solution: 

With such an error message we require you to check data on Table SysNextNumber  and also check if any open till is still available with previous business date in Store MC Till Screen. If yes, then you need to close it from Store MC . If you get an error to close it, check its Till tables in the Store database base.. 


Issue is only reported on dated version iVend ver. 6.5 Update 6 and is not noticed on the latest branch of iVend release available for production use. 


Steps if any: 

Below are the steps we require to follow-up to resolve the issue. 


1.Require to check entry Table.RtlStoreData exists on Table SysNextNumber against column NextNumberID.If not exist then we require to insert  data same as Table.Store 

 select *  from SysNextNumber where NextNumberID='Table.rtlStoredata' 

 


2. if any open till still available with previous business and unable to close/finalize due to error you need to close/finalize it.