filter problem

hi all:

i have a form that has a look up field releated to No. field of another table.when the look up arrow is pressed, the look up fom list should open but only the records with No. field that has number series starting with three specific characters should appear.can this be achieved??

thanks alot

Yes, you can … I thought. So I just tried it out in NAV.

I created a new table with two fields:

Field 1: Code (type Code 10)
Field 2: Item No. (type Code 20)

For field 2 I defined a table relation with the Item table. In the Table Filter part of the TableRelation property I defined the filter No.=FILTER(LS*) - using standard NAV I wanted to filter out all items with number starting with LS.

Now running the table entering a value in the Code field I performed a lookup on the Item No. field. Shoot, the item list shows all item records. Looking at the table filter on the Item table I see the filter on No. field is empty:

I guess this is also what you encountered?

So I tried something else: I did set a filter on the Description field of the Item table. I.e. the TableRelation property of field 2 is set to Item WHERE (Description=FILTER(Co*)). Result:

So this seems to work. [:|]

So I did not succeed in getting you a solution (yet). It seems the filter set on the primary key field No. is cleared on runtime.

still stuck [:(] . any help plz??

Hi rim,

Didnt what Luc said work? what problem are you facing in that method?

You can code it in the OnLookup trigger.

For this example it could look like:

Item2.SETFILTER(“No.”,‘LS*’);
IF FORM.RUNMODAL(FORM::“Item List”,Item2) = ACTION::LookupOK THEN

You can code it in the OnLookup trigger.

For this example it could look like:

Item2.SETFILTER(“No.”,‘LS*’);
IF FORM.RUNMODAL(FORM::“Item List”,Item2) = ACTION::LookupOK THEN