FieldRef / RecordRef

Hello, I wrote ethe following code : RecRef : RecordRef FldRef : FieldRef RecRef.OPEN(27); FldRef := RecRef.FIELD(1); // Item.“No.” FldRef.SETRANGE(‘70000’); RecRef.FIND(’-’); FOR i := 1 TO RecRef.FIELDCOUNT DO BEGIN FldRef := RecRef.FIELDINDEX(i); CASE FldRef.NAME OF // Or you can use a case on FldRef.NUMBER ‘description’: MESSAGE(’%1 is2.’,FldRef.CAPTION,FldRef.VALUE); ‘Unit Cost’: MESSAGE(’%1 is %2.’,FldRef.CAPTION,FldRef.VALUE); END; END; The following problem is this line of code : FldRef := RecRef.FIELD(1); // Item.“No.” FldRef.SETRANGE(‘70000’); The SETRANGE is a value that filters only on field no. The above code is in a loop so (repeat of a setup table), for example the first time i loop, I want to filter on Item no. the second time, i want to filter on unit cost. of a specific item where my record is positioned at. The table No. and the field no. is in a setup table of which value a have to get. How can i make this variable ? So for further example : I have the right record and then i look in my setup table where there is always a table No. and a Field No., and FldRef := RecRef.FIELD(xxx); // xxx must be the field no. of the table which is in the setup table FldRef.SETRANGE(‘xxx’); // xxx lust ve the value of the table No. and the field No. Thx a lot Steve

steve please delete this, then repost in the developers forum. thanks