seanmcne / Microsoft.Xrm.Data.PowerShell

This module uses the CRM connection from Microsoft.Xrm.Tooling.CrmConnector.Powershell and provides common functions to create, delete, query, and update data as well as functions for common tasks such as publishing, and manipulating System & CRM User Settings, etc. The module should function for both Dynamics CRM Online and On-Premise environment.
204 stars 65 forks source link

Updating gender existing null value with Male value and throws error #519

Closed nsksaisaravana closed 1 year ago

nsksaisaravana commented 1 year ago

Set-CrmRecord -conn $conn -EntityLogicalName contact -Id "xxxxxxxxxxxxxxxxxx" -Fields @{"gendercode"=1 }

I am using the above command to set value but it fails

image
seanmcne commented 1 year ago

Gendercode documentation

it is a picklist/option set value and will need to be assigned an option set type of value - instead of setting it to an int32 value of 1, assign it the following value which should be of the right type.

(New-CrmOptionSetValue 1)

nsksaisaravana commented 1 year ago

tons of thanks, working fine.