Lookup button

sridhar
Member Posts: 171
I have created textbox field (Name) in a "Card Form". I have related the field with a table using "TableRelation" property. Then I have related the field with a "List form" using "LookupFormId" property.
But, when I click the Lookup button of the Name field the list form is opening but when I choose a name from the List form the value is not stored in the Name field of the card form.
So what I have to do. Is that I have to write any code for that?
But, when I click the Lookup button of the Name field the list form is opening but when I choose a name from the List form the value is not stored in the Name field of the card form.
So what I have to do. Is that I have to write any code for that?
0
Comments
-
The easiest way to get the lookup form to display is to do everything you have up until a point:
1) Create a field.
2) Set the table relation property.
3) Make sure the table you are reading in "Table Relation" has a LookupFormID property set.
That will make the easiest lookup happen.
If the LookupFormID isn't going to be able to be used, then I believe you do need to do the assignment in code.CLEAR(lookupform); lookupform.LOOKUPMODE(TRUE); *lookupform.SETTABLEVIEW(lookuprecord); //Optional line - not always required. *lookupform.SETRECORD(lookuprecord); //Optional line - not always required. IF lookupform.RUNMODAL = ACTION::LookupOK THEN lookupform.GETRECORD(lookuprecord);
The two optional lines are usually required if you are going to set filters to the lookuprecord before performing the lookup. SETRECORD is the compliment to GETRECORD, which are used to set the record the form is selected to, and to get the selected record from the form respectively.
Hope this helps! Cheers!Kristopher Webb
Microsoft Dynamics NAV Developer0
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