Position cursor on lookup form displaying filtered records

hav
Member Posts: 299
Hi all,
I have created a table TableA(field1, field2.....................G/LAccNo). I have set the TableRelation property of G/LAccNo as ""G/L Account".No. WHERE (Account Type=CONST(Posting),Direct Posting=CONST(Yes),Gen. Bus. Posting Group=FILTER(<>''),Gen. Prod. Posting Group=FILTER(<>'')).
I then created a form FormA containing one textbox control "G/LAccountNo". The textbox control has below properties -
LookUp = Yes
LookupFormID = G/L Account List
SourceExpr = "G/LAccNo"
The FormA has SourceTable = TableA.
Now i run the form FormA and click on the assistbutton next to the textbox control "G/LAccountNo". The "G/L Account List" pops up and it shows only those records which are filtered acc. to the table filter which i had set on TableA.
I select No = 8120 and press Ok. The control "G/LAccountNo" now contains the value 8120.
I then close the form FormA and reopen it. Again i click on the assistbutton of the control "G/LAccountNo". The "G/L Account List" pops up but this time the cursor is NOT set on the record with No = 8120.
Each time i try to lookup on the form "G/L Account List" , the cursor is set to the first record of the filtered recordset. However the control does retain the selected No value.
Any idea why this happens and how to set the cursor on the selected record of the lookup form?
Thanks
I have created a table TableA(field1, field2.....................G/LAccNo). I have set the TableRelation property of G/LAccNo as ""G/L Account".No. WHERE (Account Type=CONST(Posting),Direct Posting=CONST(Yes),Gen. Bus. Posting Group=FILTER(<>''),Gen. Prod. Posting Group=FILTER(<>'')).
I then created a form FormA containing one textbox control "G/LAccountNo". The textbox control has below properties -
LookUp = Yes
LookupFormID = G/L Account List
SourceExpr = "G/LAccNo"
The FormA has SourceTable = TableA.
Now i run the form FormA and click on the assistbutton next to the textbox control "G/LAccountNo". The "G/L Account List" pops up and it shows only those records which are filtered acc. to the table filter which i had set on TableA.
I select No = 8120 and press Ok. The control "G/LAccountNo" now contains the value 8120.
I then close the form FormA and reopen it. Again i click on the assistbutton of the control "G/LAccountNo". The "G/L Account List" pops up but this time the cursor is NOT set on the record with No = 8120.
Each time i try to lookup on the form "G/L Account List" , the cursor is set to the first record of the filtered recordset. However the control does retain the selected No value.
Any idea why this happens and how to set the cursor on the selected record of the lookup form?
Thanks
Regards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
0
Comments
-
I think, that the best solution for you is to set TableRelation property of G/L Account field in your table and remove all settings from table box control.0
-
Is the field not in the table you use as sourcetable for the main form? If it is why done you just add the field without all the properties?0
-
May I know what is in the the primary key of the table and is it necessary to put Gen. Prod. Posting Group=FILTER(<>'')) in your filter.Mukesh Sharma0
-
I think, that the best solution for you is to set TableRelation property of G/L Account field in your table and remove all settings from table box control.
With TableRelation property set for the GLAccNo field of TableA, i do achieve the Lookup functionality but the problem still persist. The cursor is not set on the value displayed in the text box control when i lookup.May I know what is in the the primary key of the table and is it necessary to put Gen. Prod. Posting Group=FILTER(<>'')) in your filter.
The field Field1 of TableA is the primary key.
The reason for providing the table filter is that i will use the GLAccountNo value to create sales lines of type G/L Account and i think Navision uses the same filter if G/L sales lines are to be created on Sales Order or Quote form. Thus i do not want user to select a G/L Account No from Lookup which ultimately cannot be used to create G/L Account sales lines. So i want to display the filtered recordset in the Lookup table.Regards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)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