So, wouldn’t it be nice to see all of the groups a user is a member of or owns directly on the Edit or View User pages? In this installment I will demonstrate how to accomplish this using some functions of the Object Visualization Configuration XML for the User object. First let us establish what this is going to look like when we are done:
Object Visualization Configuration
In the example we are adding a new Grouping to the default OVC for User:
Then we add a series of controls:
I should note here that if you have any spaces in the Name property (“Member View” vs “MemberView”) that you will get a series of IE scripting errors. In this section we are making use of the UocListView control which returns the nice table. Also, note that we’re using a special token variable here to specify the FirstName of the user. The syntax is to prefix the name of the attribute with “Attribute_” and then encapsulate the token in %’s. For example:
- %Attribute_AccountName%
- %Attribute_DisplayName%
Within the control we have a series of Properties:
There are few here that I will call attention to:
- ColumnsToDisplay – this sets up the system names of the columns we expect to see in our list
- ResultObjectType – specifies the object type(s) we expect to get back
- ItemClickBehavior – there are two values possible here, ClientPopup or Server; if you choose the later then clicking on the object will trigger a postback to the item otherwise you get a popup
- UsageKeywords – optional, great if you want to turn the ShowSearchControl on and specify a filter to be used by default; in this case AllMyGroupMemberships represents a custom SearchScope I built earlier
- ListFilter – this is the inline filter that populates the list; note that we’re making use of some additional tokens here, notably the ObjectID of the user we’re currently operating on which makes the search relative
Finding Members and Owners
With the ListFilter we can specify what it is we are searching for, and in this case we have two different types of queries we are performing. In the example above we see filter for determining the groups a user is a member of by searching the ComputedMember and ExplicitMember attributes. For the Owner filter we need to look at the Owner attribute like so:
Putting It All Together
You can download the entire OVC XML files based on the default versions here:
…or you can just copy the Grouping sections out of each one and transfer them to your own custom OVC. You can find the OVC XML reference online here: