Forum Discussion

Tash2019's avatar
Tash2019
Experienced Cover User
2 years ago

Data Exception Error Trying to Delete Pay Categories

Hi there,

 

We are trying to clean up our file and removing unusued payroll categories which have NO linked transactions. We have removed these pay categories from standard pays so they have no links to any card files but when we try to delete we get error message "DataException".

 

Is there a fix for this please?

 

Thanks

 

Tash

  • Hi Tash2019 

     

    The error:

     

    The primary key value cannot be deleted because references to this key still exist. [ Foreign key constraint name = FK_ReportablePaymentSummaryFieldPayrollCategoryMap_PayrollCategory ]

     

    indicates that these payroll categories have been mapped for payment summary purposes.  So they are 'in use' and MYOB will not allow you to delete - As I mentioned - the developers didn't consider this possibility, and so did not provide a useful message to guide you to a solution. 

     

    Try going to Command Centres > Payroll > Prepare Payment Summaries (from menu bar) and go to the mapping screen and untick or de-select these pay categories, they will be linked to Gross and or Allowances - perhaps untick all.

     

    Then try to delete.

     

    Regards

    Gavin

  • Doreen_P's avatar
    Doreen_P
    MYOB Moderator

    Hi Tash2019 

     

    Thanks for your post.

     

    Please log out then log back in to your AccountRight then try to delete those payroll categories again. If you will still receive the error message, kindly attach a screenshot of the error. Make sure to remove sensitive information from the screenshot before posting in the Forum.

     

    Best regards,

    Doreen

    • Tash2019's avatar
      Tash2019
      Experienced Cover User

      Hi Doreen_P 

       

      Thank you, have tried that but it continues to occur with the same payroll categories over and over.

       

      The error message is attached.

       

      Thank you

       

      Tash

       

       

      • gavin12345's avatar
        gavin12345
        Ultimate User

        Hi Tash2019 

         

        I suspect this is from a glitch in MYOB - while you may not have any linked transactions, the pay category is likely required for some other purpose - however MYOB developers may not have prepared an appropriate message for this.

         

        Perhaps advise what the payroll category is called - this might give someone a clue as to cause.

         

        If you have never used this pay category and cannot delete it, rename it as one you will need and use that. As long it is not a system one like Base Hourly or Base Salary.

         

        Regards

        Gavin