Options

Extension not publishing nav2018

gerthectorgerthector Member Posts: 2
We get an error when republishing an extension after structure changes! In Nav we can’t install and get errors that tables already exists. Sync-navapp clean doesn’t do the tric. How can we reset the database?

Comments

  • Options
    SanderDkSanderDk Member Posts: 497
    edited 2018-11-26
    If you made a breaking change you can add schemaUpdateMode = recreate
    Obs. Your are deleting All of the data in your extension
    For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.
  • Options
    vanthanhvanthanh Member Posts: 23
    You should go to "Extension management" -> Uninstall the old extension -> Unpublish.
    After that, you can republishing your Extension.
  • Options
    SambSamb Member Posts: 18
    I am running into this issue now. I have published my app to the same database multiple times, but when I try today I am getting the error Table already exists. I did not make a change to the table in question. I have unpublished/uninstalled the app manually. I have also tried using the schemaUpdateMode = recreate. I still get the error.
  • Options
    SanderDkSanderDk Member Posts: 497
    @Samb
    Are you in a development or in production?
    Are you talking onpremis or Saas?
    When you are removing your extension, you are not deleting the tables (By design from Microsoft) this allow you to reinstall your app and still have your data.
    If you are in a test database and your are running onPremiss you can your the powershell cmdlet:
    NAVApp -ServerInstance $ServerIns -Name ''XXX -Mode Clean

    The mode clean are delete your fields from SQL
    For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.
  • Options
    SambSamb Member Posts: 18
    @SanderDk
    I am in a development database and publishing to an OnPrem version of NAV 2018. I ran the Sync-NAVApp command above, but I can still see the tables inside of the SQL database and it is giving me the same error. I ran the command again and it says that the extension is not synchronized.

    Could this be a miss leading error that I am getting. I wasn't working with tables yesterday. I renamed page extension names to be more meaning full the PageExtensionXXXX.
  • Options
    SanderDkSanderDk Member Posts: 497
    You are running with the parameter - mode clean
    and the table still exist in your database.
    Can you add -force to the sync-navapp?
    https://docs.microsoft.com/en-us/powershell/module/microsoft.dynamics.nav.apps.management/sync-navapp?view=businesscentral-ps
    If that does not do the trick you should check if the guid for the SQL table match the extension you are trying to delete. Perhaps it is in another extension
    For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.
Sign In or Register to comment.