Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter not working

Status
Not open for further replies.

woodyinoz

IS-IT--Management
Jan 8, 2002
215
GB
Hi all,

I'm trying to run a filter upon a set of values that the user enters via input boxes. The following code, for reasons I can't explain, doesn't work


method open(var eventInfo Event)

var
tbl Table
dyn DynArray[] String
gdrnum,
contnum,
strnum,
gdr String
endVar

Contnum.view ("Enter Contract No.")
Strnum.view ("Enter Structure No.")
Gdrnum.view ("Enter Girder No.")

tbl.attach("FullGirders")
dyn["Cont"] = contnum
tbl.setGenFilter(dyn)

tbl.attach("FullGirders")
dyn["Str"] = strnum
tbl.setGenFilter(dyn)


tbl.attach("FullGirders")
dyn["USER1"] = gdrnum
tbl.setGenFilter(dyn)

endMethod


Has anyone got any ideas pon how I can get this code to work?

Thanks,

Woody.
 
A bit of an update. I've also tried the following code but it tells me that the table name is and 'unkown identifier'. Even though it is the only table in the forms data model.

var
dyn DynArray[] String
Contnum,
Strnum,
Gdrnum,
stField,
stData String
endVar

Contnum.view ("Enter Contract No.")
Strnum.view ("Enter Structure No.")
Gdrnum.view ("Enter Girder No.")

stField = "Cont"
stData = Contnum
dyn[stField] = stData

FullGirders.setGenFilter(dyn)

stField = "Str"
stData = Strnum
dyn[stField] = stData

FullGirders.setGenFilter(dyn)

stField = "Gdr"
stData = Gdrnum
dyn[stField] = stData

FullGirders.setGenFilter(dyn)


Any ideas anyone?
 
Firstly a bit of an aside, what you are doing doesn't give you a problem but you only need to call FullGirders.setGenFilter(dyn) once, once you have configured your dyn[] array with the three values.

dyn["Cont"] = contnum
dyn["Str"] = strnum
dyn["USER1"] = gdrnum
FullGirders.setGenFilter(dyn)

I do something very similar, to what you are trying to do, and it works fine. I can't see anything obviously wrong with your code.

You could try specifying the whole object path as defined by the object explorer, I didn't have to do this but you never know.

My PARTS object is the name specified in the Object Explorer, but I could have included the whole object path CodeCat.allptlist.DISPLAY_BOX.PARTS

I have included the code which I have working for comparison.

var
dyn dynArray[] AnyType
endvar

setMouseShape(MouseWait)
PARTS.dropGenFilter()
if NOT manfilter_1Val.isBlank() then
dyn["OPTION_1"] = "\\"+manfilter_1Val+"\\"
endIf
if NOT manfilter_2Val.isBlank() then
dyn["OPTION_2"] = "\\"+manfilter_2Val+"\\"
endIf
if NOT manfilter_3Val.isBlank() then
dyn["OPTION_3"] = manfilter_3Val
endIf
if NOT manfilter_4Val.isBlank() then
dyn["OPTION_4"] = manfilter_4Val
endIf
if NOT manfilter_5Val.isBlank() then
dyn["OPTION_5"] = manfilter_5Val
endIf
if NOT manfilter_part.isBlank() then
dyn["PART_NO"] = manfilter_part
endIf
if NOT manfilter_serco.isBlank() then
dyn["SERCO NO"] = manfilter_serco
endIf

PARTS.setGenFilter(dyn)
setMouseShape(MouseArrow)

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top