Application Delivery Management
Application Modernization & Connectivity
CyberRes by OpenText
IT Operations Management
When creating new request workflows with IDM Designer and using one of the default workflow forms, you will typically get a recipient selector field with the default Object Selector.
Sometimes you may want to replace this selector with a custom search.
In this example we will use IDM Designer to create a custom search that allows users to enter Given Name and/or Surname for their search; this search will only return users that do not have their 'Login Disabled' attribute set.
Here's how to proceed:
* General
Use the name 'queryUsers' and a display label of your choice
Select "User" as Query Entity
* Parameters:
Add 2 parameter references: 'paramSurname' and 'paramGivenName' with display labels of your choice
* Query Conditions
Add a new Condition Grouping with 3 conditions
'Last Name' 'starts with' '%paramSurname%'
and 'First Name' 'starts with' '%paramSurname%'
and 'Login Disabled' 'not equals' 'true'
* Search
Add the appropriate Search Root, Search Scope, and Max Entries
We will use this query in our form to search for users that match the Surname and Given Name that we enter in the form.
After saving your new Query, you may need to flush the Cache in administration tab of User Application
* 'fldSurname' (Data type: string, Control Type: text)
* 'fldGivenName' (Data type: string, Control Type: text)
* 'fldSearchBtn' (Data type: string, Control Type: Html)
* 'fldMatches' (Data type: dn, Control Type: PickList)
* For the 'fldSearchBtn' field add this line as 'HTML Content' (get the single and double quotes right)
' <input type=\"button\" name=\"btnSearch\" value=\"Search\" onclick=\"runQuery();\" />'
* For the 'fldMatches' field, use 'User' as Entity key and 'LastName, FirstName' as Display Expression
var globalVars = new Object();
// called from form:onload to permanently remember some global vars
function storeGlobalVars( IDVault, form )
{
globalVars.IDVault = IDVault;
globalVars.form = form;
}
// called from custom HTML field to run the query
function runQuery( )
{
try
{
var SN = globalVars.form.getValue( "fldSurname" );
var GN = globalVars.form.getValue( "fldGivenName" );
if (( SN == undefined ) || ( SN == "" )) SN = "*";
if (( GN == undefined ) || ( GN == "" )) GN = "*";
// run the query and store the results into the "fldMatches" field
globalVars.IDVault.globalQuery(
"fldMatches",
"queryUsers",
{"paramSurname":SN, "paramGivenName":GN })
}
catch ( e )
{
alert( "runQuery error: " e );
}
};
storeGlobalVars( IDVault, form );
This will store the variables 'form' and 'IDVault' in a global form memory area to ensure that you can access them anytime.
Of course you may want to add other search fields and run a different query, but all you have to do is:
Environment used:
Identity Manager Version 3.6.x/3.7.x
IDM Designer 3.5