Hello folks,
i have a problem where i need some help. We do have a company where there are different subcompanies. Each sub has different departments.
What i do want now is following:
i created a form where the first screen is the company and there is a second section with the department. If the company is changed i want that the departments (i do have an array of them for every company) is now populated as a dropdown.
I do have succesfully preprovisioned the attributes when nothing is changed. But when i change the company from A to B i still get the attributes populated of company A.
Which scriptpolicy is triggered when an attribute is changed? I think this is my problem which I do struggle with at the moment. OnGetEffectivePolicy is only called when i open the form initally. On Changing the Company from A to B nothing is done. Please help me :-)
Here are some codesnippets:
function onGetEffectivePolicy($Request)
{
if($Request.Class -ne "user"){return}
$test = $DirObj.GetInfo
#$Request >> C:\tmp\departmentchange.txt
$test >> C:\tmp\departmentchange.txt
$nachname = $DirObj.Get("sn")
$vorname = $DirObj.Get("givenName")
[void]($DirObj.GetInfoEx(@('edsvaAccountType'),0))
$VAValue = $DirObj.Get("edsvaAccountType")
$accounttype = $VAValue
$nachname >> C:\tmp\departmentchange.txt
$vorname >> C:\tmp\departmentchange.txt
$accounttype >> C:\tmp\departmentchange.txt
## Firmennamen setzen
if ($accounttype -ne $null){
switch ($accounttype){
"Extern" {
$externeFirmen = @("A", "B", "C")
$Request.SetEffectivePolicyInfo("company", $Constants.EDS_EPI_UI_POSSIBLE_VALUES, [string[]]$externeFirmen)
}
"Intern" {
$Companies = @("A","B","C")
$Request.SetEffectivePolicyInfo("company", $Constants.EDS_EPI_UI_POSSIBLE_VALUES, [string[]]$Companies)
}
default{
$Request.SetEffectivePolicyInfo("company", $Constants.EDS_EPI_UI_GENERATED_VALUE, "")
}
}
}
#"test1234" >> C:\tmp\departmentchange.txt
$abteilungen = @(Get-Content C:\Abteilungen\Immobilien.txt)
$Request.SetEffectivePolicyInfo("department", $Constants.EDS_EPI_UI_POSSIBLE_VALUES, [string[]]$abteilungen)
}