Open Forum

Expand all | Collapse all

Powershell command Sync-NavTenant list is truncated

Jump to Best Answer
  • 1.  Powershell command Sync-NavTenant list is truncated

    TOP CONTRIBUTOR
    Posted 11 days ago
    In upgrading to NAV 2018 one of the steps is to "Sync Schema for All Tables" which can be done from Dev environment or Powershell.  Powershell is better since you can see the output.  So when running this command: Sync-NavTenant [YourServiceTierName] -Mode Sync if there are destructive changes it rolls back and lists all of the tables and fields that are being changed or deleted like this for example:
    Table: 111, Sales Shipment Line
    Field: 84012, Return Item No.: Deleted
    Table: 113, Sales Invoice Line
    Field: 84012, Return Item No.: Deleted
    Table: 355, Ledger Entry Dimension
    Field: 1, Table ID: Data type changed
    Field: 2, Entry No.: Data type changed
    Field: 3, Dimension Code: Data type changed
    Field: 4, Dimension Value Code: Data type changed
    etc...

    This is totally expected during an upgrade and is typically resolved by using an upgrade codeunit.  Turns out that due to our add-on's there are so many changes to list that it truncates the list and I can't see all the changes.  Just as an aside, not a single one of our add-on's included an upgrade codeunit with their product to resolve this (not cool).

    So my question is this:  Isn't there a way to run a powershell command to a file instead of the screen which would most likely end up creating the full list?  Or some other way to see the full results from the Sync-NavTenant command.

    ------------------------------
    Jason Wilder
    Senior Application Developer
    Stonewall Kitchen
    York ME
    ------------------------------


  • 2.  RE: Powershell command Sync-NavTenant list is truncated
    Best Answer

    GOLD CONTRIBUTOR
    Posted 10 days ago
    Add the out-file command to your script.
    Sync-NavTenant [YourServiceTierName] -Mode Sync -verbose | Out-File -FilePath C:\Sync.txt

    ------------------------------
    Mathew Ealy
    Nav Support Specialist
    Rentokil N. America
    Reading PA
    ------------------------------



  • 3.  RE: Powershell command Sync-NavTenant list is truncated

    TOP CONTRIBUTOR
    Posted 9 days ago
    Exactly what I was looking for, thanks!

    ------------------------------
    Jason Wilder
    Senior Application Developer
    Stonewall Kitchen
    York ME
    ------------------------------



  • 4.  RE: Powershell command Sync-NavTenant list is truncated

    TOP CONTRIBUTOR
    Posted 9 days ago
    I spoke too soon.  This:
    Sync-NavTenant DynamicsNAV110-2 -Mode CheckOnly -verbose Out-File -FilePath "C:\bin\Sync.txt"

    causes this error:

    A positional parameter cannot be found that accepts argument 'Out-File'.

    ------------------------------
    Jason Wilder
    Senior Application Developer
    Stonewall Kitchen
    York ME
    ------------------------------



  • 5.  RE: Powershell command Sync-NavTenant list is truncated

    GOLD CONTRIBUTOR
    Posted 9 days ago
    Edited by Mathew Ealy 9 days ago
    you need to include the pipe | , you are sending the output of the first command  to the out-file powershell command.

    ------------------------------
    Mathew Ealy
    Nav Support Specialist
    Rentokil N. America
    Reading PA
    ------------------------------



If you've found this thread useful, dive deeper into User Group community content by role