Filter on FieldRef.

Hi, I did this before, but I just forgot how I did it. So maybe you all can help me here? I’m trying to place a filter on a FieldRef Like this: RecField := RecRef.FIELD(FieldNo); RecField.SETRANGE(FilterValue); But this will give an conversion error if the field is an option and the FilterValue is text. How can I set a filter on a field without conversion errors? I did this before, so I know it’s possible… But I deleted my database and my memory is really bad.

I haven’t enough time to build a example for your problem, but IIRC using SETFILTER instead of SETRANGE should work. Alex

well, I’d try that, but can’t seem te get it working… yet. If you have the time, please make me an example. I’ll be here trying all the things I can come up with. Sooner or later I should come up with the solution I used last time.

This is working. RecRef.SETFILTER(FilterString); The error was coursed by something else. I toke me 23 debug sessions, 2 programmed erros, 6 programmed messages and a collega to figure this out. Heil Navision!