Allam Purushotham

Allam Purushotham

  • 435
  • 3.2k
  • 59.6k

how to update multi select option set field in d365 using power shell

Mar 22 2024 9:04 AM

# Define the values for the multi-select picklist attribute
$optionSetValues = @(484800005, 484800001, 484800003)

# Create account data
$account = @{
    "name" = "A Viansh"                    # Single Line Text
    "Multiselection" = $optionSetValues  # Multi-Select Option Set
}

# Update the account record
$accountRecord = Set-CrmRecord -conn $conn -EntityLogicalName account -Id accounId -Fields $account
----------------------------
 

# Define the values for the multi-select picklist attribute
$optionSetValue1 = New-CrmOptionSetValue -Value 484800005
$optionSetValue2 = New-CrmOptionSetValue -Value 484800001
$optionSetValue3 = New-CrmOptionSetValue -Value 484800003

# Create account data
$account = @{
    "name" = "AViansh"                    # Single Line Text
    "Multiselection" = @($optionSetValue1, $optionSetValue2, $optionSetValue3)  # Multi-Select Option Set
}

# Update the account record
$accountRecord = Set-CrmRecord -conn $conn -EntityLogicalName account -Id accountId -Fields $account
 


Answers (2)