web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Business Central forum

How to create Upgrade Codeunit with TableSyncSetup in Business Central?

(0) ShareShare
ReportReport
Posted on by 1,455

Hi,

I changed the Primary Key for one of the table in Extension. Now when publish the extension, it will not allow to publish and shows the following error.

SchemaUpdateMode=synchronize failed with code 422. Reason:
Table XYZ :: An unsupported key change was detected. Keys cannot be changed, removed, or reordered. New keys can only be added to the end of the list.
If i modify the SchemaUpdateMode=Recreate, all the data will be erased.
So i want to create the Upgrade Codeunit for the same. So i created the Codeunit with SubType = Upgrade and created a function by name TableSyncSetup.
But now i am unable to set the Property of function to TableSyncSetup and passing the parameter is also not allowed.
Error : "The type or method 'Table Synch. Setup' cannot be used for 'Extension' development"
I have referred the following links.
Please suggest with your answers.
Thank you.
Categories:
  • MohitMalik8085 Profile Picture
    100 on at

    Hi Avinas,

    Have you got some solution for your issue, if so could you please help me, I have also changed the primary key and writing a upgrade codeunit..

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans