Skip to Content
0
Former Member
Jun 08, 2006 at 07:03 PM

Searching with several fields on the same Table with MDM COM API

15 Views

Hi,

I'm using the MDM COM API and I have the following issue:

I want to make a search on the Products table based in the following conditions:

All Products which "Description" has the keyword = "Car" and Material Group = "2"

I have found that the following can narrow the search but only with one field at a time, but can't find how to make the quey with both fields (Material Group and Description):

rsd.Table = "Products"

rsd.Fields.Append("Material Number")

rsd.Fields.Append("Description")

rsd.Fields.Append("Material Type")

rsd.Fields.Append("Material Group")

rsd.Fields.Append("Base Unit")

searchTable = "Products"

displayField = "Description"

displayField2 = "Material Type"

searchString = "Car"

searchString2 = "2"

s.SearchTable = rsd.Table

s.Parameters.NewFreeFormParameter(searchTable).Fields.New(displayField).FreeForm.NewString(searchString, FreeFormSearchTypeEnum.xcPrefixSearchType)

's.Parameters.NewFreeFormParameter(searchTable).Fields.New(displayField2).FreeForm.NewString(searchString2, FreeFormSearchTypeEnum.xcEqualToSearchType)

' s.Parameters.NewLookupParameter()

rs = Catalogo.GetResultSet(s, rsd, "Material Number", True, 0)

Any advice is welcome