Skip to content

[BUG] Duplicate view created when using -Name #1401

@robwood-TTECDigital

Description

@robwood-TTECDigital

Description

This resulted in a second view being created even though one with same name was already present

$config = @{
    TableName = 'ed_contact'
    DefaultViewName = 'Active Contacts'
    Columns = @('ed_firstname', 'ed_lastname', 'ed_companyname', 'statuscode')
},

    # Update the default view with the specified columns
    $viewParams = @{
        TableName = $config.TableName
        Name = $config.DefaultViewName
        Columns = $config.Columns
        ViewType = 'System'
        QueryType = 'MainApplicationView'
        PassThru = $true
    }
    
    $view = Set-DataverseView @viewParams -ErrorAction Stop

Steps to Reproduce

Expected Behavior

Actual Behavior

PowerShell version

Module Version

No response

Additional Context

Checklist

  • I have tried the latest version of the module
  • I have searched for similar issues and couldn't find any
  • I have included all the information needed to reproduce the issue

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions