Skip to Content
0
Jun 03, 2009 at 11:15 AM

Search Users

15 Views

Dear All,

I am trying to search users available in EP through WDJava. Search Parametres will be

first name, last name and userID.

Now, to search users by name, i am using the below code...

if(wdContext.currentVn_SearchEmpElement().getVa_EmpFName()!=null || wdContext.currentVn_SearchEmpElement().getVa_EmpLName()!=null)

{

if(wdContext.currentVn_SearchEmpElement().getVa_EmpFName()!=null && wdContext.currentVn_SearchEmpElement().getVa_EmpLName()!=null)

{

strSearchName=wdContext.currentVn_SearchEmpElement().getVa_EmpLName()"*"wdContext.currentVn_SearchEmpElement().getVa_EmpFName();

}

else

{

if(wdContext.currentVn_SearchEmpElement().getVa_EmpFName()!=null)

strSearchName=wdContext.currentVn_SearchEmpElement().getVa_EmpFName();

else if(wdContext.currentVn_SearchEmpElement().getVa_EmpLName()!=null)

strSearchName=wdContext.currentVn_SearchEmpElement().getVa_EmpLName();

}

uFilt.setDisplayName(""strSearchName"",

ISearchAttribute.LIKE_OPERATOR,false);

ISearchResult result = uFact.searchUsers(uFilt);

if (result.getState() == ISearchResult.SEARCH_RESULT_OK) {

while (result.hasNext()) {

String uniqId = (String) result.next();

IUser thisuser= uFact.getUser(uniqId);

cmb=new CallMemoBean();

cmb.setStrEmpFName(thisuser.getFirstName());

cmb.setStrEmpLName(thisuser.getLastName());

cmb.setStrEmpId(thisuser.getUniqueName());

serarchList.add(cmb);

}

Is there any better way to search users...

Regards,

SrinivaS