Modify Data on all Tenants

ArturoArturo Member Posts: 30
edited 2014-05-06 in NAV Three Tier
Hello,
I have a Nav multi-tenant setup. I want to modify a table data on every tenant-company at once, without open an edit every single company registers.
The tenants change often, so i wonder if there is any shared table where i can find either one of the tenants, in order to automate the process, and write a script on SQL that modifies one specific table for all tenants at once.
Thank you very much for your help.

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Yes, you can do this with powershell. It supports both NAV and SQL Server.
  • ara3nara3n Member Posts: 9,256
    do you need to run nav business logic?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • ArturoArturo Member Posts: 30
    ara3n wrote:
    do you need to run nav business logic?
    No, I don't. I only need to insert a record on the "Job Queue entry" Table.
    Thank you, i'm going to try with Power Shell.
  • ArturoArturo Member Posts: 30
    Finally i write this script in powershell to run a specific procedure of a CU for all tenants (first of all you should import Nav module for powershell).

    $Tenants = Get-NAVTenant -ServerInstance DynamicsNAV71
    foreach ($Tenant in $Tenants)
    {
    $comps = Get-NAVCompany -ServerInstance DynamicsNAV71 -Tenant $tenant.id

    foreach ($comp in $comps)

    {
    Invoke-NAVCodeunit -CodeunitId 7172402 -ServerInstance DynamicsNAV71 -CompanyName $Comp.CompanyName -MethodName fResetProjectQueStatus -Tenant $Tenant.Id

    }
    }
Sign In or Register to comment.