Howto: Prefill an attribute value based on another attribute (prior to clicking on [Apply])

When creating/editing a user object in Active Roles, I would like to be able to generate (let's say) the PhysicalDeliveryOfficeName attribute according to the value entered in the Description attribute. I don't want this to occur AFTER I click on [Apply] or [Ok] but as my user types in the description value,

In other words, as the Description attribute is being filled, I want a script to evaluate the description value and immediately fill the PhysicalDeliveryOfficeName - in similar ways I would achieve that using a "Property Generation and Validation" policy. "Property Generation and Validation" will simply not allow me to perform the evaluation I want.

I have inspiring myself from the "
How to create a Bound List-box with 4 Levels (4244019)" without success. 

Any help/sample would be appreciated.

 

  • Hi  

    I'm assuming you're using "EDS_EPI_UI_GENERATED_VALUE"? Try instead using "EDS_EPI_UI_POLICY_RULE", in this you can use the same rule type as seen in a PGV. This should do the trick, you can use this instead of the generated value option.

    IE

    #### Some code to get a value for your description

    $MyDescription = Get-MyDescription $Request

    $Request.SetEffectivePolicyInfo('description', $Constants.EDS_EPI_UI_POLICY_RULE, [string]$MyDescription)                 

  • Thank you for your answer Stu. I am still possibly doing something wrong since it is not behaving the way I want it. Let me provide additional information on how I set it up.

    As a reminder, when either creating or editing a user in ARS, I want my "physicalDeliveryOfficeName" attribute to be dynamically build/set as I fill in other fields (like "Description"for example) in the exact same way I would achieve it with PGV.

     1. Created a new PS script module (policy script) with the following code:

     #------------------------------------------------------------
    function onGetEffectivePolicy($Request){

        $MyDescription = GetCurrentValue $Request 'Description'
        #--> tried both EDS_EPI_UI_POLICY_RULE and $Constants.EDS_EPI_UI_GENERATED_VALUE on the next line
        $Request.SetEffectivePolicyInfo('physicalDeliveryOfficeName', $Constants.EDS_EPI_UI_POLICY_RULE, [string]$MyDescription) 

    }

    #------------------------------------------------------------
    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
    }

    ....saved it under "PDON_update".

    2. Created a new Provisioning Policy "MyTestPolicy" / Script Execution and selected the script module "PDON_Update".

    3. Selected the appropriate containers where I want my policy to apply.

    4. As I edit a user object in the targeted OU, and filling the Description field, I am expecting that the PhysicalDeliveryOfficeName gets filled synchronously.

  • Well, after couple of months, I am back in this with the same issue.

    Stu's proposal did not work for me. I guess I am still missing something. Could anyone confirm that it can at least be accomplished? ...meaning trapping "live" any changes made to the description attribute and as-being-typed, run a validation script that will adjust the value in the physicaldeliveryofficename attribute. Validation could also occur as the user " tabs out” of the "description” field/attribute. 

    The equivalent in .NET would correspond to the "_OnChange" event.

    Desperately looking for a solution here.

  • This can be accomplished. If this is on the web interface, using code the new value has to be on the next page. 

    Page 1, description, 
    Page 2, your physicaldeliveryofficename attribute

    or on the same page
    I create a third attribute, set that attribute to equal the description, then I hide it. I have to do this for the Name attribute constantly, but sometimes it is funny behaving. I try to use the PGV policy for this, that way it's live...

    Reload by rule means, every time the attribute is change (description) in this case, the below steps execute/ 

    $strAttrname = physicaldeliveryofficename
    # Call the SetEffectivePolicyInfo method
    $Request.SetEffectivePolicyInfo($strAttrname, $Constants.EDS_EPI_UI_RELOAD_EPI_BY_RULE, "Description")
    $Request.SetEffectivePolicyInfo($strAttrname, $Constants.EDS_EPI_UI_DISPLAY_NOTE, "The value is offered by administrative policy")
    $Request.SetEffectivePolicyInfo($strAttrname, $Constants.EDS_EPI_UI_AUTO_GENERATED, $strAttrname)
    $Request.SetEffectivePolicyInfo($strAttrname, $Constants.EDS_EPI_UI_GENERATED_VALUE, $userName)

  • Thank you Jacob for you feed-back. Unfortunately, I wanted this feature to work in the AR native console. That doesn't seem to work.

    I was testing the script that is provided in the SDK - One Identity Active Roles named "Example: Creating Bound List-boxes"

    In the AR console, as i change the department from the list, the Titles attributes list is not refreshed until I click on [Apply], close the user properties windows and reopen it. Only then, the Department related Title list shows up correctly. 

    From what I understand, in that in the AR console, there is no way to trigger "live" re-evaluation of my policy as one attribute gets modified. The rule is loaded into memory and will not be reevaluated until the edit form window is closed and reopened. 

  • That script sample will only function in the Active Roles Web Interface, by design. This is confirmed in the Active Roles SDK. It is not possible to create a bound list-box in the Active Roles Console due to limitations in the MMC API.