One of the coolest things about NetWeaver Identity Manager is that there are always new tricks to learn. The development team keeps finding new and interesting ways to extend the functionality of the product. This, in turn, allows us to further extend what we can offer to our customers. Sometimes what I learn for a particular customer is brand-new, sometimes it's functionality that's been around for years, but either way, it's usually of use to someone, so I like to share when I can.
Recently I was asked by a client how we could link two fields together so that for a given value chosen in the first field via a pull down box would result in a specific subset of values being available in the second pull-down.
After a bit of research and some emailing I found that the use of the FIELD attribute prefix was the way to go. Here's how it all works:
In your database, create a table called LOCATIONS
The database should be populated with two columns called COUNTRY and CITY as shown below:
United States New York
United States Atlanta
United States Los Angeles
Norway Oslo
Norway Trondheim
United Kingdom London
United Kingdom Liverpool
Spain Madrid
Spain Barcelona
In NetWeaver Identity Management, create two attributes called COUNTRY and CITY. Set the Displayname and tool-tip in the Presentation tab as you would like but make sure presentation is set to SingleSelect.
Next go to the Attribute values tab and set up the SQL Queries as follows:
COUNTRY: select distinct COUNTRY from LOCATIONS (We want to use distinct so we don't see duplicate entries when we use the pull-down)
CITY: select CITY from COUNTRY where COUNTRY = %FIELD.COUNTRY%
Now add these attributes to a task and make sure they are added to the screen in the attributes tab so that we can see them from the Web UI.
Basically what's going on here is that we now compare the first value we enter, that of the country to the table itself and then presents a list of cities that result from the match. Locations are an easy example, but I can also see a use in listing business units and departments or anything where you have a long list and want to be able to just look at sub-sets.
There you go! Have fun with this... Wondering what other customizations have people been making? How do you extend the interface?
4 comments:
great thing. thanks for sharing. I regularly follow your blog and like it.
That is pretty handy. I'm glad I found this as I was working on:
Select Attrname AS Repository from mxiv_sentries where mskey in (
Select mskey from mxiv_sentries where attrname = 'mskeyvalue' and searchvalue = %FIELD.MSKEYVALUE% )
AND attrname LIKE 'ACCOUNT%'
To get a repository dropdown for a user.
Heath, always a pleasure! How's your project going?
Matt
Another important point on using singleline / singleselect and queries on external (non-IdM) tables. The mxmc_prov user must have SELECT rights to the table which is created under mxmc_rt.
M
Post a Comment