EDS_EPI_UI_POSSIBLE_VALUES with EDS_EPI_UI_RELOAD_EPI_BY_RULE

Hi,

We have several OUs and each OU can have one or more companies and Address information.

All this information is stored in a CSV, and when creating users, we provide a drop-down to choose from based on OU.

I wanted to provide a process to move users between different OU and in the process also information should be changed.

Since i can't automate things, my idea was to provide an OU drop-down where to move, and then based on the OU choice, address and company are shown.

For this i looked into the "Creating bound list-boxes" Example,

the code seems to work but somehow no possible values are shown for company

this is the debug output 

DEBUG:     ! SET $possibleValues = 'My Company'.
DEBUG:  433+ 		 >>>> $Request.SetEffectivePolicyInfo($AttrMoveCompany, $Constants.EDS_EPI_UI_POSSIBLE_VALUES, [string[]]$possibleValues)

 Call method '$Request.SetEffectivePolicyInfo'
     Arguments list:
         [1] : Value=edsvaUserNamedMoveCompany : Type=System.String
         [2] : Value=3 : Type=System.Int32
         [3] : Value=System.String[] : Type=System.String[] : IsMultivalued=True : Count=1
                 [0] : Value=My Company : Type=System.String


  Call '$Request.get_EffectivePolicyInformation'
  Call '$Request.get_EffectivePolicyInformation'
DEBUG:  435+  >>>> }

that my code example

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
}

function onGetEffectivePolicy($Request)
{
	######### Control #########
	$Formname = "MoveOU"
	
	# Exit function if request is not for a user
	if ($Request.Class -ne 'user') { return }
	
	# Catch GetInControl NULL
	try
	{
		$Form = $Request.GetInControl("Form")
	}
	catch
	{
		return
	}
	if ($Form -eq $Formname)
	{

		$AttrMoveOU = "edsvaUserNamedMoveOU"
		$AttrMoveCompany = "edsvaUserNamedMoveCompany"
		

		$CSVImport = Import-Csv -delimiter ";" -Encoding default -Path "E:\One Identity\CSV\Company.csv"
		$OUs = $CSVImport.OU | select -uniq
		$possibleValues = @()
		
		$Request.SetEffectivePolicyInfo($AttrMoveCompany, $Constants.EDS_EPI_UI_RELOAD_EPI_BY_RULE, $AttrMoveOU)
		
		$Request.SetEffectivePolicyInfo($AttrMoveOU, $Constants.EDS_EPI_UI_RESTRICTED, $TRUE)
		$Request.SetEffectivePolicyInfo($AttrMoveOU, $Constants.EDS_EPI_UI_POSSIBLE_VALUES, [string[]]$OUs)
		$Request.SetEffectivePolicyInfo($AttrMoveOU, $constants.EDS_EPI_UI_AUTO_GENERATED, $true)
		
		$CurrentOU = GetCurrentValue -Request $Request -AttributeName $AttrMoveOU
		$possibleValues = $CSVImport | Where-Object { $CurrentOU -like $_.OU } | Select-Object Company -ExpandProperty Company -uniq
		$Request.SetEffectivePolicyInfo($AttrMoveCompany, $Constants.EDS_EPI_UI_POSSIBLE_VALUES, [string[]]$possibleValues)
	}
}

Parents
  • Trying putting the OU on one tab, and the company on another, it might be that the reload is only happening when moving between tabs in your form.

  • i just tried but it's still the same, it shows an empty box

    I can see in debug log that EDS_EPI_UI_RELOAD_EPI_BY_RULE triggers an reload, i see the variable are filled with values based on the choice made from GUI.

    if my $possibleValues is filled with one or more values i just dont understand why its not displayed with this policy

    $Request.SetEffectivePolicyInfo($AttrMoveCompany, $Constants.EDS_EPI_UI_POSSIBLE_VALUES, [string[]]$possibleValues)

    its the same as few lines before when i load OUs from CSV and provide a drop down list. This Shows me all OUs

    $Request.SetEffectivePolicyInfo($AttrMoveOU, $Constants.EDS_EPI_UI_POSSIBLE_VALUES, [string[]]$OUs)

  • I have been looking at this today in version 8.1.1 and I can say that it appears the functionality of this has stopped working as it is expected to be working.

    It seems to work properly if setting the Level 1 value, OU in this case, from the drop-down list and then saving it. Next, go back into the properties of the user. Level 2, company in this case, will then properly display the listed values in a drop-down list from the CSV file. Changing Level 1 to something else will update Level 2's possible values accordingly within a few seconds.

    The way it used to function/should be functioning, upon initial implementation of this, both attributes should appear as empty, drop-down lists, until a value is selected for Level 1, then within a few seconds, Level 2 should update.

    I would open a support case on this. Thanks.

  • I have included the example script once to test and it works. I can open the properties for an existing AD user and then the values are adjusted according to the selection of the department without clicking on save on the Properties Form.

    The difference to the example with me is

    • Custom Form
    • My values are loaded from the CSV into a variable at the beginning instead of defining the values in an array at the beginning
    • no switch statement

    If this should work in my use case then I would open a support case

Reply
  • I have included the example script once to test and it works. I can open the properties for an existing AD user and then the values are adjusted according to the selection of the department without clicking on save on the Properties Form.

    The difference to the example with me is

    • Custom Form
    • My values are loaded from the CSV into a variable at the beginning instead of defining the values in an array at the beginning
    • no switch statement

    If this should work in my use case then I would open a support case

Children
No Data