Hi
I need to update some property patterns on a scheduled basis and am doing this via a powershell script.
The particular attibute will be a drop down, but for ease of use I would like to set a default value if the list only has one option.
I've got the following which configures the attribute correctly, but is there a way to set the default value?
$item = $userPattern.Items.Create()
$item.PropertyName = "primaryTelexNumber"
$item.IsPropertyRequired = $True
$constraints = $item.GetConstraints()
$constraint = $constraints.Create("ADM_PROPERTYCONSTRAINTTYPE_VALUERANGE")
$constraint.AreValuesDenied = $False
$constraint.Values = @($dlList)
$constraints.Add($constraint)
if ($dlList.Count -eq 1) {$constraints.DefaultValue = $dlList[0]} #This doesn't work!
$item.SetConstraints($constraints)
$item.SetInfo()
$userPattern.Items.Add($item)
Thanks
Matt