NetTalk Central

Author Topic: Display description instead of value  (Read 4269 times)

bergsj

  • Jr. Member
  • **
  • Posts: 81
    • MSN Messenger - swjvandenberg@hotmail.com
    • View Profile
    • Email
Display description instead of value
« on: May 24, 2010, 11:50:52 PM »
Hi there,

I'm using the lookup function which has a new feature called 'Display description instead of value'. This works great if you have a lookup table with an ID field in the Value field of the template and a nice description field in the Description field of the template.
In my case I do not use the ID field as the value field but only the Description field. When I select the record and press Select, the description is not shown.
This only works when I use the ID as the value field.

Is this by design or maybe a bug I am facing?

Any help would be appreciated.
Greetz,
Sjoerd

bergsj

  • Jr. Member
  • **
  • Posts: 81
    • MSN Messenger - swjvandenberg@hotmail.com
    • View Profile
    • Email
Re: Display description instead of value
« Reply #1 on: May 24, 2010, 11:55:38 PM »
OK let's narrow things down. This is because the lookup browse is using the Unique Key with ID as it's field. When adding a new Key in the DCT on the description field a specifying that in the browse it is working. However this is not a unique key so this is not a solution.
Greetz,
Sjoerd

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Display description instead of value
« Reply #2 on: May 25, 2010, 12:51:51 AM »
Hi Sjoerd,

Ok, I think I understand your situation - but let me see if I have it right.

You have a table (say "customers") which you are doing a lookup on. the customers table has a primary ket (some sort of Id) but what you're really interested in is the customer name.

Now you have a table (invoices) which will do a lookup on customers. You will get the customer name (not the id) and store this in the invoices record. However the customer name is _not unique_ (and hence the key on cusotmer name is not unique)?

Have I got it right?
Bruce


bergsj

  • Jr. Member
  • **
  • Posts: 81
    • MSN Messenger - swjvandenberg@hotmail.com
    • View Profile
    • Email
Re: Display description instead of value
« Reply #3 on: May 25, 2010, 03:49:17 AM »
Bruce, that's correct in your example I want to save the customername in the invoice record, not the ID. In that case it is not working.
Greetz,
Sjoerd

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Display description instead of value
« Reply #4 on: May 25, 2010, 09:43:55 PM »
Hi Sjoerd,

Try adding the assignment to the "More Assignments" list.

ie set up the lookup as-if you were gonna store the unique code part. So value = Id, Desc = Name and so on.
Then in the more assignments part set the Inv:Customer = Cus:Name.

(I'm intrigued that you're storing a non-unique part of a lookup record, but that's not really material to the answer.)

cheers
Bruce


bergsj

  • Jr. Member
  • **
  • Posts: 81
    • MSN Messenger - swjvandenberg@hotmail.com
    • View Profile
    • Email
Re: Display description instead of value
« Reply #5 on: May 26, 2010, 01:50:48 AM »
Thanks Bruce,

Seems to work like a charm. I'm not able to actually save the record, but as soon as I'm done I will test if the non-unique value (it's a postal code for anonymous logging of request) is saved in the record and not the ID value.

Regards,
Sjoerd
Greetz,
Sjoerd