fieldref.Setfilter on Primary key fields - does not work ?

activ8
Member Posts: 25
Hello,
I want to place a filter on a fieldref, this works fine but
from the moment i want to do this on fields that part of the primary key,
the filter does not seems to work. (NAV 4.0SP3)
refRecord.OPEN(18);
fieldRef := refRecord.FIELD(2); --> Name field of customer table
fieldRef.SETFILTER('*test*'); --> this worksfine if the fieldref is not a primarykey field for example the name field.
IF refRecord.FIND('-')
REPEAT
... --> only the customers with test in the name = OK
UNTIL refRecord.NEXT = 0;
END;
refRecord.OPEN(18);
fieldRef := refRecord.FIELD(1); --> No. field of customer table = Primary Key
fieldRef.SETFILTER('K00001|K00011');
IF refRecord.FIND('-')
REPEAT
... --> all the customer records = NOT OK
UNTIL refRecord.NEXT = 0;
END;
Any what causes this problem ?
I want to place a filter on a fieldref, this works fine but
from the moment i want to do this on fields that part of the primary key,
the filter does not seems to work. (NAV 4.0SP3)
refRecord.OPEN(18);
fieldRef := refRecord.FIELD(2); --> Name field of customer table
fieldRef.SETFILTER('*test*'); --> this worksfine if the fieldref is not a primarykey field for example the name field.
IF refRecord.FIND('-')
REPEAT
... --> only the customers with test in the name = OK
UNTIL refRecord.NEXT = 0;
END;
refRecord.OPEN(18);
fieldRef := refRecord.FIELD(1); --> No. field of customer table = Primary Key
fieldRef.SETFILTER('K00001|K00011');
IF refRecord.FIND('-')
REPEAT
... --> all the customer records = NOT OK
UNTIL refRecord.NEXT = 0;
END;
Any what causes this problem ?
0
Comments
-
I tried it and it works. But I had problems with "fieldRef". I had to rename it.
This is the code for a Cronus:rer.OPEN(18); fir := rer.FIELD(1); fir.SETFILTER('10000|20000'); IF rer.FIND('-') then REPEAT fir := rer.field(1); MESSAGE('<%1>',fir.value); UNTIL rer.NEXT = 0;
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions