Lookup after manual text input in textfield of form

KnutsenKnutsen 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?

Comments

  • AlbertvhAlbertvh Member Posts: 516
    Hi Knutsen,
    You could try using the AltSearchField property on the No. field of the Item table
  • KnutsenKnutsen Member Posts: 7
    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.
  • AlbertvhAlbertvh Member Posts: 516
    Hi Knutsen,
    You would enter the external item no. in the Item No. field
  • KnutsenKnutsen Member Posts: 7
    Hi Albertvh,

    erm... yeah, right. :oops:
    Thanks, it's working! :thumbsup:
  • AlbertvhAlbertvh Member Posts: 516
    You're welcome :D
Sign In or Register to comment.