on 06-03-2009 12:15 PM
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
Hi Srinivas,
Check this document it will help you in some extent
Thanks,
Tulasi Palnati
Edited by: Tulasi Palnati on Jun 3, 2009 2:27 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tulasi,
Thank you very much for reply. But in that document he is searching users usind UniqueName(...), which will search users with given userID. I want to search them on the basis of
First Name (if not null),
Last Name (if not null) and First Name+Last Name (if both are not null)
I am able to achieve the first two, but for the last option as i am not able to set the filter twice, i am using setDisplayName.... Any help???
Regards,
SrinivaS
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.