TableRelation Ignores my Table Filter

Bagheera
Member Posts: 57
When clicking on the lookup button of the field Doctor No. Ι want to get the lookup list displaying ONLY the doctors that have their Hospital Code set to a value that I get from another field. So this is the TableRelation in complete
And this is the Table Filter alone.
D@mn thing ignores me or dumb me that I get ignored, the full list of doctors comes up... Any ideas?
Doctor.No. WHERE (No.=FIELD(Doctor Code),Hospital Code=FIELD(Hospital Code))
And this is the Table Filter alone.
No.=FIELD(Doctor Code),Hospital Code=FIELD(Hospital Code)
D@mn thing ignores me or dumb me that I get ignored, the full list of doctors comes up... Any ideas?

0
Comments
-
If the Hospital Code isn't the Primary Key your Lookup won't work or let's say ... it shows you all records
So you must program the Lookup into the OnLookup-Trigger.
0 -
OK, I see
in OnLookup of that field I have specified a Recordset I filtered it the way I want and I assigned it to a Form (the form is specified in Globals).
How do I assign the Global Form with the filtered record to my filter in order to display it. At the moment it has the lookup button but it does nothing when you click it...
Thanks for ur valuable help.0 -
OK,
found an answer in a previous post...Doctors.RESET; Doctors.SETCURRENTKEY("Hospital Code"); Doctors.SETFILTER("Hospital Code", "Hospital Code"); IF FORM.RUNMODAL(55006, Doctors) = ACTION::LookupOK THEN BEGIN Text := Doctors."No."; EXIT(TRUE); END ELSE EXIT(FALSE);
It works excellent now. Thank you.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