Migration Error - Foreign key constraint name = FK_NZGSTReturnOptions_OutputTaxAccount

This thread is now closed to new comments.
Some of the links and information provided in this thread may no longer be available or relevant.
If you have a question please start a new post.
Betabiz
Experienced Cover User
62 Posts
Experienced Cover User
New Zealand
Experienced Cover User

62Posts

10Kudos

1Solutions

Solved: Go to Solution

Migration Error - Foreign key constraint name = FK_NZGSTReturnOptions_OutputTaxAccount

Hi

 

Am trying to upgrade a V19 AccountRight Standard file to 2023.2.  Below is my log.

 

The linking for the GST codes is all correct, there are no linked adjustment codes in the Prepare GST return.  I dont know where else to look.

 

Can anyone shed any light on this for me please?

 

Unsuccessful: Migration failure

Company File Name : C:\Users\User\AppData\Local\MYOB\Temp\company file name.MYO
Start Time : 04/04/2023 16:27:26 PM
End Time : 04/04/2023 4:30:19 PM

Migration Warnings:
- Warning1 : Inserting Constraints: A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = FK_NZGSTReturnOptions_OutputTaxAccount ]

Migration errors:
Source : UpgradeUtility
Method : Upgrade
Error : (UpgradeException):
Extra info : System.Data.SqlServerCe.SqlCeException (0x80004005): A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = FK_NZGSTReturnOptions_OutputTaxAccount ]
at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText(IntPtr& pCursor, Boolean& isBaseTableCursor)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
at AR.Common.Database.SQLTask.ExecuteSQL(String sqlScript, SqlCeCommand command)
at AR.Common.Database.SQLTask.Execute()
at AR.Common.Database.SqlCeFileWrapper.ExecuteScripts(IEnumerable`1 scripts)
at MYOB.Huxley.UpgradeUtility.DbCeManager.InsertFkConstraints()
at MYOB.Huxley.UpgradeUtility.UpgradeStepsToV1.DbInsertFKConstraintsUpgradeStep.ProcessStep()
at MYOB.Huxley.UpgradeUtility.UpgradeStep.Process()
at MYOB.Huxley.UpgradeUtility.UpgradeUtility.Upgrade()

Unsuccessful upgrade!

2 REPLIES 2
gavin12345
Ultimate User
5,041 Posts
Ultimate User
Australia
Ultimate User

5,041Posts

913Kudos

640Solutions

Accepted Solution Solved

Re: Migration Error - Foreign key constraint name = FK_NZGSTReturnOptions_OutputTaxAccount

Hi @Betabiz 

 

In your v19 file, go to the Accounts Command Centre and select Prepare GST Return. Check the value for GST Output Tax Adjustment - the error seems to indicate the account selected here cannot be found in the accounts list. Try clearing any value here. If it is already clear, it may only appear to be and may actually hold a corrupt value, so try setting it to a valid existing account. Close and re-open this screen to ensure the entry sticks - if not there is likely a file corruption issue. If the account is now a valid account, try the upgrade again. Let us know how you get on.

 

Regards

Gavin

(gavinw222@gmail.com)
Betabiz
Experienced Cover User
62 Posts
Experienced Cover User
New Zealand
Experienced Cover User

62Posts

10Kudos

1Solutions

Re: Migration Error - Foreign key constraint name = FK_NZGSTReturnOptions_OutputTaxAccount

Thanks Gavin

 

I had removed the value for the GST outputs adj box - so I added a new GST GL code, added that to the outputs adjustment in the GST return, optimised the file then tried the upgrade again ... and it worked!!!

 

Appreciate your help - thank you 

Didn't find your answer here?

Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post