on 08-01-2007 11:17 AM
Hi,
I spent hours reading the forum yesterday and I'm still unsure how to achieve what I want to do.
I find the MDM Java API extremely complex (I hope I am not the only one).
I want to be able to search on main table records based on qualified link values.
Main table "Products", has field "AFS_Season" qualified link to a qualified table "AFS_Season".
"Season" contains fields "Season", "Market", "Theme".
There could be multiple links to this qualified table.
All I want is get all records in Products where it has link to records of Themes = T1 OR T2.
Something as simple as that is not easily achievable.
Search search = new Search(c_Products);
search.SetSearchType(Search.GlobalOrSearchCombinationType);
FreeFormTableParameter fftp =
new FreeFormTableParameter("AFS_Season");
FreeFormParameterField ffpf =
fftp.GetFields().New(
"Theme",
FreeFormParameterField.SEARCH_OPERATOR_OR);
ffpf.Add(
new StringParameter(
"T1",
FreeFormParameter.SoundsLikeSearchType));
ffpf.Add(
new StringParameter(
"T2",
FreeFormParameter.SoundsLikeSearchType));
search.Add(fftp);
rs = catalog.GetResultSet(search, rsd, c_Material_Number, true, 0);
This code doesn't work.
If I only have one value and not both it works.
PS. I tried separating it into two FreeFormParameterField, or two FreeFormTableParameter, but both doesn't work.
What is somethign so simple so complex?
Please help.
Cheers
Michael.
Hi Michael,
I'm assuming here that, "Theme" is YES quialifier for the qualified table.
Try specifying the FreeFormParameter as below,
FreeFormParameterField ffpfName1 = fftpNames.GetFields().New("Theme",
FreeFormParameterField.SEARCH_OPERATOR_OR);
ffpfName1.GetFreeForm().NewString("T1", FreeFormParameter.SubstringSearchType);
ffpfName1.GetFreeForm().NewString("T2", FreeFormParameter.SubstringSearchType);
There is an amazing blog on Free Form Search, which you can find <a href="http:///people/andreas.seifried/blog/2006/03/26/performing-free-form-searches-with-mdm-java-api
Hope this helps.
Regards,
Mausam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michael,
Can you please confirm the search that you are trying to do, can be done through Data Manager "Free Form Search" ( You can find it on the bottom left with the small arrow mark ). If that is possible then and then you can go ahead with Java APIs.
Logically, with whatever fields of Qualified Table you are planning to search, they must be "YES" qualifiers. This ensures these fields are part of Main Table rather than Qualified.
Thanks,
Mausam
Hi, Just to add, i've now tried through data manager with the query mentioned above.
I tried to do the same in Java API and it is NOT WORKING.
Can any experts out there help me with this very simple search query with an OR condition?
// For season, themes, and market, we have to look in AFS_Season table
FreeFormTableParameter afs_season_fftp =
new FreeFormTableParameter(c_AFS_Season);
// For season, themes, and market, we have to look in AFS_Season table
FreeFormParameterField searchField =
afs_season_fftp.GetFields().New(c_Theme, FreeFormParameterField.SEARCH_OPERATOR_OR);
searchField.GetFreeForm().NewString("01", FreeFormParameter.EqualToSearchType);
searchField.GetFreeForm().NewString("02", FreeFormParameter.EqualToSearchType);
User | Count |
---|---|
86 | |
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.