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 :
Small and medium business | Business Central, N...
Answered

Unable to publish extensions involving Item table in Business Central

(6) ShareShare
ReportReport
Posted on by 13
Hello Guys,
 
In my Business Central sandbox, I am unable to publish any extension that involves the Item table or Item Card. Extensions for other tables (e.g. Customer, Sales line) work fine.
 
When adding fields to an Item, only Code or Boolean types succeed.
 
Adding Decimal, Date, or other field types always fails with an error:
“An unexpected error occurred after a database command was cancelled. The original extensions have been restored.”
 
I have already tried creating a completely new extension with unique field IDs and names, but the issue persists.
Could you please advise how to resolve this? Is it related to schema synchronization or residual extensions on the Item table?
 
Thank you.
{EA4894FC-B831-4FDD-A7C1-2D31CFA5F77F}.png
I have the same question (0)
  • Suggested answer
    Rishabh Kanaskar Profile Picture
    6,225 Super User 2026 Season 1 on at
    Hi,
     
    This usually happens because the Item table is heavily used and has dependencies, especially in standard Business Central tables and pages. Decimal, Date, or other field types require schema changes that the sandbox cannot handle automatically if there are residual or conflicting extensions.
     
    Possible solutions:
    > Check for residual extensions: Remove any previously published extensions that touched the Item table.
    > Incremental field IDs: Make sure the new field IDs do not conflict with any existing or deleted fields.
    > Use a fresh sandbox: Sometimes sandbox databases retain old metadata; creating a new sandbox often resolves publishing issues.
    > Publish in stages: Add only one new field at a time to minimize schema lock conflicts.
    > Check AL code: Ensure decimal/date fields have default values if marked mandatory and proper table extension references.
     
    If the issue persists, this may require Microsoft support, as certain table schema changes in production or long-lived sandboxes can fail silently.
     
    Thanks
    Rishabh
  • Suggested answer
    Aman Kakkar Profile Picture
    3,465 Super User 2026 Season 1 on at
    Hi,
     

    It seems like a schema synchronization issue.

    Try the below mentioned approaches (you’ll need to test which one resolves it in your sandbox):

    1.  Go to launch.json, and try using "schemaUpdateMode": "ForceSync". Use this with caution as it might delete your data.
    2. Go to Extension Management and review any extensions with a Publisher other than Microsoft. Check with your colleagues which of these can be removed, as they may interfere with your extension deployment.
    3. If the above approaches don’t work, create a new sandbox environment or test the same code in another sandbox to verify if the issue is environment-specific.
    I hope it helps.
    Aman K
  • Suggested answer
    Gregory Mavrogeorgis Profile Picture
    1,397 Super User 2026 Season 1 on at
    You’re hitting that error because Business Central didn’t like a schema change you made. In short: a field on your Item table extension used to look one way, and now it looks different (type/length/ID changed). BC tried to update the database, couldn’t do it safely, and rolled your app back.
    You’ll see it as:
    “An unexpected error occurred after a database command was cancelled… The original extensions have been restored.”
    What probably changed
    • Boolean → Integer (or any type change)
    • Text length reduced
    • Option ↔ Enum swap
    • Field ID reused for a different purpose
    • Field removed while it still has data
    Quick ways to unblock yourself
    If this is just a disposable dev sandbox (data can be lost):
    1. Uninstall your app and delete the extension data, then publish again.
      —or—
    2. Temporarily set "schemaUpdateMode": "Recreate" in .vscode/launch.json, publish once, then set it back to "Synchronize".
    If you need to keep data (the “proper” way):
    1. Don’t change the field in place. Keep the old field, add a new field (new ID, correct type).
    2. Mark the old field ObsoleteState = Pending for now.
    3. Create an Upgrade codeunit to copy data from old → new.
    4. Bump the app version, publish, run upgrade.
    5. Later, when everyone’s migrated, set the old field to Removed.
    TL;DR
    You changed a field in a way the database can’t auto-upgrade. Either nuke-and-recreate in a dev box, or do it right with a new field + upgrade codeunit to move the data.
     
    If you found this helpful please mark it as a verified solution
  • Suresh Kulla Profile Picture
    50,278 Super User 2026 Season 1 on at
    Is your current extension installed as 'Dev', 'PTE', or 'Global'? Are you using OnPrem or Saas version
  • Suggested answer
    Sahan Hasitha Profile Picture
    2,683 on at
    hi,
    This issue occurs due to a schema synchronization problem with the Item table, which is one of the most complex and heavily used tables in Business Central. When publishing an extension that modifies this table, the synchronization may fail or become corrupted, especially if earlier Item-related extensions were not properly uninstalled. As a result, adding new fields like Decimal or Date triggers the error “An unexpected error occurred after a database command was cancelled. The original extensions have been restored.”
    To resolve this, first uninstall and unpublish any previous extensions that modify the Item table. Then, perform a Force Sync on the tenant using the Admin Center or PowerShell to refresh the database schema. Clear your VS Code cache, download symbols again, and try publishing a small test extension that adds a single field (such as a Date type). If it succeeds, add more fields gradually. If the issue persists, restart your sandbox or create a new sandbox environment, as the existing one may have a corrupted schema state. This process ensures that the Item table schema is clean and synchronized, allowing your extension to publish successfully.
  • Verified answer
    Pallavi Phade Profile Picture
    5,550 Super User 2026 Season 1 on at
    Namaste @CU03101250-0
     
    For Above Issue , The root cause observed is schema reltaed changes  for Table Item used in said extension. 
     
    1) Clear Credentials
     
    2) Take Backup of Item Table , Before executing
     
    Set SchemaUpdatemode as Force Sync in Lauch.json file and publish 
     
     
    Since we have set Schema Update mode as Force , there are chances of data loss . Ensure backup .
     
     
     
     
    If you feel this helped , Please mark as "Verified"
     
     
     
     
     
     
    Regards
    Pallavi Phade 
  • Suggested answer
    YUN ZHU Profile Picture
    100,688 Super User 2026 Season 1 on at
    Hi, hope the following can give you some hints.
    Force sync of customer-specific extensions in online environments (ForceSync mode in Production Environment)
    In-depth testing for Force Sync mode in Production Environment (Renaming tables, Renaming fields, Changing field type…)
     
    Thanks.
    ZHU

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,865 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,098 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 898

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans