Hello Steve,
To implement such a solution:
I. Create Business Rules that update a multivalued property with values of the properties that you need to be visible:
First, you need to create Business Rules that will automatically update a certain multivalued property with values of the properties that you want to show. For this purpose, you'll need to create a Business Rule triggered after creating an object (to populate the values of the properties once a new object is created) and another once triggered after updating an object (to update the values of the properties once anything is changed). To create such Business Rules:
-
Create a new Business Rule.
-
On the 2nd step, in the Object Type section, select the type of objects that you want the Business Rule to update. For example, if you want the Business Rule to update users, select User.
-
In the Operation section, select :
- After Creating <Object type> - if you are creating a Business Rule for populating the multivalued property for new objects,
- After Updating <Object type> - if you are creating a Business Rule for updating the multivalued property of existing objects.
where <Object type> is the type of objects you selected on step 2.
-
On the 3rd step, add the Run a program or PowerShell script action and paste the following script:
$propertiesToDisplay = @("description", "title", "l", "manager") # TODO: modify me
$propertyToUpdate = "adm-CustomAttributeTextMultiValue1" # TODO: modify me
# Check whether it is necessary to update property values in the multivalued property
if ($Context.Action.IsOperationOftype($Context.TargetObject, "set properties"))
{
$updatePropertyValues = $False
foreach ($property in $propertiesToDisplay)
{
if ($Context.IsPropertyModified($property))
{
$updatePropertyValues = $True
break
}
}
if (!$updatePropertyValues)
{
return
}
}
# Get display names for all properties
$culture = [System.Globalization.CultureInfo]::CurrentCulture
$attributeFriendlyNamesCache = [Softerra.Adaxes.Directory.AttributeFriendlyNamesCache]::GetInstance($culture)
$propertyEntires = @()
foreach ($propertyName in $propertiesToDisplay)
{
# Get display name for the property
if ($attributeFriendlyNamesCache.HasFriendlyName($propertyName))
{
$propertyEntry = $attributeFriendlyNamesCache.GetFriendlyName($propertyName, "user")
}
else
{
$propertyEntry = $propertyName
}
$propertyEntry += ": "
# Get property value
try
{
$propertyValue = $Context.TargetObject.Get($propertyName)
}
catch
{
$propertyValue = ""
}
$propertyEntry += $propertyValue
$propertyEntires += $propertyEntry
}
# Save property values to the multivalued property
$Context.TargetObject.Put($propertyToUpdate, $propertyEntires)
$Context.TargetObject.SetInfo()
-
Modify the following in the script to match your requirements:
- $propertiesToDisplay - specifies a list of properties that must be displayed. You need to specify the properties by the LDAP names. The property names need to be included in double quotes and separated by commas.
- $propertyToUpdate - specifies the name of the multivalued property that will be updated with values of the properties specified in $propertiesToDisplay.
-
Enter a short description for the script and click OK.
-
Finish creation of the Business Rule.
II. Show values for the properties on the forms for editing users
For information on how to add the multivalued property to the form for editing objects so that users can view the values for the properties while editing objects, see step 6 of the Customize Forms for User Creation and Editing Tutorial.
If you want to show the values for the properties only on the form used by a certain Home Page Action, see section 3 under Modify Object.
III. Change display name for the multivalued property
Since a name like CustomAttributeTextMultiValue1 won't tell you much about the meaning and the function of the field, you may want to give it your own name. For information on how to do this, see the following help article: http://www.adaxes.com/help/?HowDoI.Mana ... Names.html.