FIM2010-Uniqueness Checking In RCDC’s

I was playing around in an environment the other day and remembered a couple settings that I was chatting with some others about that were really handy if you have uniqueness requirements for a field that is editable by the user community.

To set it up, you need to add a property to the the property is called UniquenessValidationXPath.

The format for the property is:

<my:Property my:Name=”UniquenessValidationXPath” my:Value=”<xpath filter>” />

For an example, I have added this property to my DisplayName attribute in the RCDC for the create and edit actions. The XPath filter itself is

/Person[DisplayName=’%VALUE%’ and not(ObjectID=’%ObjectID%’)]

So the complete control looks like:

<my:Control my:Name=”DisplayName” my:TypeName=”UocTextBox” my:Caption=”{Binding Source=schema, Path=DisplayName.DisplayName}” my:Description=”{Binding Source=schema, Path=DisplayName.Description}” xmlns:my=”http://schemas.microsoft.com/2006/11/ResourceManagement”>
  <my:Properties>
    <my:Property my:Name=”Required” my:Value=”{Binding Source=schema, Path=DisplayName.Required}” />
    <my:Property my:Name=”Columns” my:Value=”34″ />
    <my:Property my:Name=”MaxLength” my:Value=”64″ />
    <my:Property my:Name=”Text” my:Value=”{Binding Source=object, Path=DisplayName, Mode=TwoWay}” />
    <my:Property my:Name=”UniquenessValidationXPath” my:Value=”/Person[DisplayName=’%VALUE%’ and not(ObjectID=’%ObjectID%’)]” />
  </my:Properties>
</my:Control>

So now when I try to enter a duplicate displayname in my user object, I end up with the error “This value already exists. Please try a different one.” (shown in the picture below) when I try to navigate to the next tab.

image

Note that in the filter itself, there is a reference back to the object ID of the current object.

/Person[DisplayName=’%VALUE%’ and not(ObjectID=’%ObjectID%’) ]

This is required for the Edit RCDC as the filter always returns a positive match for the displayName value if the object exists within the environment already. Hence the extra step of filtering out the objects with the same Object ID became required.

Advertisements
This entry was posted in Forefront Identity Manager 2010. Bookmark the permalink.

One Response to FIM2010-Uniqueness Checking In RCDC’s

  1. Pingback: XPath tool | cartesian product

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s