Lookup after manual text input in textfield of form

Knutsen
Member Posts: 7
Hi there,
I have got a form displaying several records ("BANF Line"). The records and the form contain two references to "Item". Our "Item" has been extended with an additional (external) product number. So the Item.No is still primary key, but the external product number is unique too.
So the form has two columns for the two product numbers. The first column ("No.") uses the automatic lookup feature, but the second doesn't of course. I managed to implement a manual lookup for the external product number. Therefore the user can click on the lookup arrow, search for the corresponding item and select it. But many users already know the product number and would like it to enter it directly into the text-field. Without additional code I'm getting the message, that the external product number isn't part of the primary key, which is correct of course. But I don't want to alter "Item" and the primary key... When I'm trying to change the OnAfterInput-Trigger and putting some manual lookup-code into it, I'm getting the message, that I cannot change the database before opening a transaction. That's because I tried to validate the Item.No when finding the corresponding Item for the external product number, and Navision doesn't allow that...
Does anybody have a hint, how I manage to update the record in my form after a direct input into the text-field?
I have got a form displaying several records ("BANF Line"). The records and the form contain two references to "Item". Our "Item" has been extended with an additional (external) product number. So the Item.No is still primary key, but the external product number is unique too.
So the form has two columns for the two product numbers. The first column ("No.") uses the automatic lookup feature, but the second doesn't of course. I managed to implement a manual lookup for the external product number. Therefore the user can click on the lookup arrow, search for the corresponding item and select it. But many users already know the product number and would like it to enter it directly into the text-field. Without additional code I'm getting the message, that the external product number isn't part of the primary key, which is correct of course. But I don't want to alter "Item" and the primary key... When I'm trying to change the OnAfterInput-Trigger and putting some manual lookup-code into it, I'm getting the message, that I cannot change the database before opening a transaction. That's because I tried to validate the Item.No when finding the corresponding Item for the external product number, and Navision doesn't allow that...
Does anybody have a hint, how I manage to update the record in my form after a direct input into the text-field?
0
Comments
-
Hi Knutsen,
You could try using the AltSearchField property on the No. field of the Item table0 -
Hi Albertvh,
I have changed the AltSearchIndex of Item.No. from "Search Description" to the field of our external product number, but it doesn't work out... the message stays. Afterwards I have set TableRelation=Item (before Undefined) and Lookup=Yes (before No) of the Properties of the FormField, but it hasn't any effect either.0 -
Hi Knutsen,
You would enter the external item no. in the Item No. field0 -
Hi Albertvh,
erm... yeah, right. :oops:
Thanks, it's working! :thumbsup:0 -
You're welcome0
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