on 09-29-2005 8:59 AM
Hi all,
We are using API version 5.5.15.09. (SP1) on MDM server SP1 as well.
We experience a problem when using java API:
when we create a search object and add lookup parameters on 2 fields with the 'OR' operator (GlobalOrSearchCombinationType), no result is returned.
The same code is working on String parameters
The code sample is:
Search search = new Search();
search.SetSearchTable("Products");
SearchParameters searchParam = search.GetParameters();
search.SetSearchType(Search.GlobalOrSearchCombinationType);
String fieldName1 = "GroupType1";
int recordID1 = 51;
LookupParameter lookupParam = searchParam.NewLookupParameter("Products",fieldName1);
lookupParam.Add(recordID1);
String fieldName2 = "GroupType2";
int recordID2 = 52;
LookupParameter lookupParam = searchParam.NewLookupParameter("Products",fieldName2);
lookupParam.Add(recordID2);
We expect to get all products belonging to GroupType1 OR GroupType2 but we get products belonging to GroupType1 AND GroupType2 which can be 0 product
thanks for your help
Nicolas
Hi Nicolas,
The code given below is working in MDM5.5 (SP2), I am not sure about SP1. Hope it helps.
String fieldName1 = "GroupType1";
int recordID1 = 51;
LookupParameter lookupParam = searchParam.NewLookupParameter("Products",fieldName1);
lookupParam.Add(recordID1);
//Set OR condition here
lookupParam.SetSearchOperator(LookupParameter.SEARCH_OPERATOR_OR);
String fieldName2 = "GroupType2";
int recordID2 = 52;
LookupParameter lookupParam = searchParam.NewLookupParameter("Products",fieldName2);
lookupParam.Add(recordID2);
Regards,
Ananth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ananth and first of all thanks for your help,
unfortunately it does not solve our issue.
Let me give you more information:
the 'OR' we want to apply is not on the lookupParameter but on the search itself. That is why we use the search.SetSearchType(int) method.
In addition, this search.SetSearchType(int) method works perfectly when the search object only contains String parameters.
Would it be possible that the search.SetSearchType(int) method is not working for all parameter types?
thanks again
Nicolas
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.