Forum Discussion

Tash2019's avatar
Tash2019
Experienced Cover User
3 years ago
Solved

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

7 Replies

Replies have been turned off for this discussion
  • Doreen_P's avatar
    Doreen_P
    MYOB Moderator
    3 years ago

    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
    3 years ago

    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
    3 years ago

    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

  • Tash2019's avatar
    Tash2019
    Experienced Cover User
    3 years ago

    Thank you - there are various different wage categories that are not deleting, there doesnt seem to be a pattern to which ones I can delete and which ones I can't, but none of them are the base system categories.

     

    Annual leave - with no linked wage expense account

    Annual leave loading

    IT allowance

    Motor Vehicle allowance

    Team leader allowance (there were 6 identical categories and I have been able to delete 3)

     

    Changing the titles is a good idea but there are about 30 of them so a permanent solution would be much better.

  • gavin12345's avatar
    gavin12345
    Ultimate User
    3 years ago

    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

  • Tash2019's avatar
    Tash2019
    Experienced Cover User
    3 years ago

    That seems to have done the trick - thank you so much! You've saved us a huge amount of hassle!