I have heard and read that the Uniqueness Validation of an attribute does not work well in Edit mode of an object. There is some info on the internet about a “workaround” which is to exclude the object from the XPath so use this
/Person[DisplayName=’%VALUE%’ and not(ObjectID=’%ObjectID%’)]
Which is what you would use during creation of the object.
Well I can tell you the workaround does not work. Take for instance you want to validate the lastname field, it works if the lastname field already exits and you are modifying it. But if there is no lastname and then you add a lastname while in Edit mode of the object, the validation does not run.
I wanted to validate a field and ran into this. Would be nice if it worked while the user is entering the data. I will be looking at using Jquery to consume Json data from a REST API wrapper on the FIM Service, but that will be later. In the meantime, the field I want to validate is actually one controlled FIM via Jquery. I am building the name based on choices the user makes in the form. How do I test if the name is duplicated? I use the PowerShell workflow.
1/ Create a PowerShell to do a loop validation of that field. Its actually going to write back to that field. Make sure you exclude the object itself in the XPath.
2/ Create a workflow to run the PowerShell
3/ Create an MPR to trigger the workflow when the field changes or is created
This solution is good if FIM totally controls the final result of the field. But where the field is determined by the user, then you have to do a live validation which is where I have to use Jquery and REST. I will post on that when ready.