Sage 100

 View Only

Does anyone have this file referenced in the Sage KB - Sage 100 Premium 2021 or later error converting AP_Checkhistoryheader "duplicate key"

  • 1.  Does anyone have this file referenced in the Sage KB - Sage 100 Premium 2021 or later error converting AP_Checkhistoryheader "duplicate key"

    Posted 09-06-2023 09:08
    Edited by Wayne Schulz 09-06-2023 09:08

    If you have this patch referenced below I would appreciate a copy so I can archive it in the 90 Minds file storage. 

    Sage 100 Premium 2021 or later error converting AP_Checkhistoryheader "duplicate key"

    Summary

    In Premium Sage 100 2021 or later, failing when converting existing older data that was migrated to the new install of Sage 100 Premium.

    Full error reads:

    The following conversion record failed while converting XXX:\07.00.00.00:DATA:CI_BankCodeListWrk:000001:000 - Error converting AP_CheckHistoryHeader at record...
    Operating system command failed. OS Error:23000: [Microsoft][SQL Server Native Client 11.0][SQL Server]Violation of PRIMARY KEY constraint 'KPRIMARY_AP_CheckHistoryHeader_1925550220'. Cannot insert duplicate key in object 'dbo.AP_CheckHistoryHeader_1925550220'.
    The diplicate key value is (C, 0000053941, 000000).
    Error converting AP_CheckHistoryDetail at record G004233 00000000030333191 00000. The error was Error #15: Operating System command failed.
    OS Error: 23000:[Microsoft][SQL Server Native Client 11.0][SQL Server]Violation of PRIMARY KEY constraint
    'KPRIMARY_AP_CheckHistoryDetail_1925670220'. Cannot insert duplicate key in object 'dbo.AP_CheckHistoryDetail_1925670220.' The duplicate key value is (C, 0000054090, 00000, CK54090, 00000)
    View the Activity Log to locate a specific conversion log.

    Cause

    As the Check No field in AP_CheckHistoryHeader and AP_CheckHistoryDetail was expanded in 2021 version of Sage 100, the conversion is failing when it finds two values in old data (migrated over) that would convert to the same value in the expanded field.

    For example, check no 054090 & 54090 when expanded would both be 0000054090 (padded with leading zeroes).

    This is not the same as Related Resources which are due to a Comma or Decimal point in the Check No field.

    Resolution

    This is a data issue with 2 Check Number (Check No) values that are similar but in the expanded field would equal the same value and violates Premium restriction for duplicate key on the table.

    The original values must be modified in SQL to allow for 2 unique records when expanded. Both the AP_CheckHistoryHeader and AP_CheckHistoryDetail records would need to be modified for the problem record(s)

    • Contact Sage Support for Program fix for CheckNo's beginning with 'APP' in Sage 100 2021.0 - 2021.3



    ------------------------------
    Wayne Schulz
    wayne@s-consult.com
    Schulz Consulting
    (860) 516-8990
    Moodus, CT
    ------------------------------