Hi.
Just having some strange oddities with bound list box and wondering if there is anything that can be done to make it better.
I have as an example below 5 departments and 5 divisions. When you select Department1 the only option for Division is also 1. Thats is working and all departments only show the correct division.
The issue i have is. Lets say i select Department1 and the click the Division drop down. Sometimes i am having to click it multiple times before it will display 1. Then if i change to Department2 and click Division i still see 1 unless i click Division multiple times before it will display 2.
Is there anything i can do to make this more fluid? We are trying to stop our Service Desk from using the wrong department and division
Thanks in advance
function onGetEffectivePolicy($Request)
{
$level1 = GetCurrentValue $Request 'Department-TEST'
$level2 = GetCurrentValue $Request 'Division-TEST'
$level1PossibleValues = @('Department1', 'Department2', 'Department3', 'Department4', 'Department5' )
switch($level1)
{
'Department1' { $level2PossibleValues = @( '1' ) }
'Department2' { $level2PossibleValues = @( '2' ) }
'Department3' { $level2PossibleValues = @( '3' ) }
'Department4' { $level2PossibleValues = @( '4' ) }
'Department5' { $level2PossibleValues = @( '5' ) }
default { $level2PossibleValues = @( '-', '-' ) }
}
$Request.SetEffectivePolicyInfo('Department-TEST', $Constants.EDS_EPI_UI_POSSIBLE_VALUES, [string[]]$level1PossibleValues)
$Request.SetEffectivePolicyInfo('Division-TEST', $Constants.EDS_EPI_UI_POSSIBLE_VALUES, [string[]]$level2PossibleValues)
$Request.SetEffectivePolicyInfo('Division-TEST', $Constants.EDS_EPI_UI_RELOAD_EPI_BY_RULE, 'Department-TEST')
$Request.SetEffectivePolicyInfo('Department-TEST', $Constants.EDS_EPI_UI_RESTRICTED , $true)
$Request.SetEffectivePolicyInfo('Division-TEST', $Constants.EDS_EPI_UI_RESTRICTED , $true)
}
function GetCurrentValue($Request, [string]$AttributeName)
{
trap {continue}
$value = $Request.Get($AttributeName)
if($value -eq $null)
{
$DirObj.GetInfoEx(@($AttributeName),0) | Out-Null
$value = $DirObj.Get($AttributeName)
}
$value
}