NetTalk Central

Author Topic: Lookup with Display Description instead of Value saving an incorrect lookupID  (Read 2393 times)

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
I have found an anomaly when using a lookup with the Display Description instead of Value checked.
If I select a record where the start of the name of the Supplier is a number (e.g. 100%Suite, 3GMobile, 15th Avenue Products (all of these are valid Supplier names)).
When the lookup returns to the form the name 100%Suite appears in the field but the value stored is 100 rather than 351 which is the valueID of the Supplier 100%Suite, so that when I return to the browse the name of the Supplier attached to 351 is displayed.
Is there a workaround other than renaming the Supplier? The user is now used to having the description displayed in the field so I would like to avoid having to uncheck the Display Description.

Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Rene Simons

  • Hero Member
  • *****
  • Posts: 649
    • View Profile
Hi Tery,

Obvious but probably unecessary question:
Has the lookup file a unique key on description??
This is a must when you want to use the Display Description option.

Rene
Rene Simons
NT14.14

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Yes it has. The ID is unique autonumbered and the description is a unique key. This is consistent whenever I test it. If you have a description where the first characters are numeric then this is used as the value rather than the field set as the value. I imagine that this only applies to records where the numbers at the start of the description are in the same range as the values but I haven't tested that yet.
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: 11179
    • View Profile
Hi Terry,

ok, the problem is a tad complex, and there's no trivial work-around for it at the moment.
I've done a fix for the next build, but it's too complex to post here.

The root problem is that when it tests the code key (first)
the
file:code =  3gMobile
since fil:code is a long, this means
file:code =  3
and since a supplier with code 3 exists, this fetch is ok.

If this is urgent let me know.

cheers
Bruce


 

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Thanks Bruce
My timescale for finishing the project is the end of January so if a fix is available by then that would be great.
I can in the meantime switch the setting Display Description instead of Value off so thay can continue capturing the information.
I imagine this could affect a number of people, you never know when a client is going to add a record where the first characters are numeric.
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: 11179
    • View Profile
cool - the fix is done so will be in the next build.

cheers
Bruce