NetTalk Central

Author Topic: Look up in forms, Name key  (Read 5257 times)

Edvard Korsbaek

  • Newbie
  • *
  • Posts: 19
    • View Profile
    • Email
Look up in forms, Name key
« on: November 10, 2016, 12:38:46 PM »
Hi all!
I still cannot get my lookup to work.
Bruce told me today to add a name key for the displayfield.
Have done, but no difference.
I think, that i should add the key 'Somewhere', but has not found it.
I have been looking through the accounts example, where customers has 'namekey' as the one I look after, and i can see on the source, that it is added, but where, thats the question.

Who will help?

Best regards

Edvard Korsbæk

Edvard Korsbaek

  • Newbie
  • *
  • Posts: 19
    • View Profile
    • Email
Re: Look up in forms, Name key
« Reply #1 on: November 11, 2016, 12:46:21 AM »
Hi again!

Its so, that I have  a table 'contact_persons', which do have 3 fields:
Firstname
Lastname
ID

In my table Contacts, i have a value for:

ID_For_Contactperson

What i Show in the form is Firstname, and what i want to save is ID in field ID_for_Contact_person.

I had a key for ID on Contact_Persons
Bruce learned me last evening in the nettalk group, that i too neded a key on  firstname to make a lookup work

So i added the key with firstname as only item.

That did not help - And I think, that the reson why is, that the lookup do not know this key.

And i think that i will have to 'Learn' the webform about it - Have just not found where.

Best regards

Edvard

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Look up in forms, Name key
« Reply #2 on: November 11, 2016, 08:19:50 PM »
Hi Edvard.
The description key has to be unique (otherwise how will Nettalk know which Edvard in you first name list is the person you are dealing with). It means that you would probably be better off creating a field in your table combining first+Last plus something to make it unique and giving that a unique key to use.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Edvard Korsbaek

  • Newbie
  • *
  • Posts: 19
    • View Profile
    • Email
Re: Look up in forms, Name key
« Reply #3 on: November 11, 2016, 11:01:29 PM »
Hi Edvard.
The description key has to be unique (otherwise how will Nettalk know which Edvard in you first name list is the person you are dealing with). It means that you would probably be better off creating a field in your table combining first+Last plus something to make it unique and giving that a unique key to use.

Hi Terry!

I know that, and i will find a way to get around it.

The problem is - How do Nettalk know which key to use as description key.

Best regards

Edvard

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Look up in forms, Name key
« Reply #4 on: November 12, 2016, 09:37:37 PM »
Hi Edvard. I may be misunderstanding the question.  In the lookup settings of the NetWebForm the value field is the value that will be stored in your table, the Description field is the field that will display if Display Description instead of value is checked.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Look up in forms, Name key
« Reply #5 on: November 13, 2016, 10:02:54 PM »
>> The problem is - How do NetTalk know which key to use as description key.

it's automatic - there's no setting for this. You've set the description field in the lookup settings, so the template can find the key to match that field easily enough.

Is your description field unique?

When you say it is not working, can you describe what is happening?

Cheers
Bruce