NetTalk Central

Author Topic: lookup button display description  (Read 4734 times)

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
lookup button display description
« on: August 29, 2010, 01:53:34 PM »
I have a simple invoice with an item code lookup to an inventory table. I use single longs as primary autoinc keys for everything.
When I put the field on the form with the lookup button, and check the display description instead of value, the value never gets saved in the invoice record.
I even added it to the More Assignments list, but no joy.
I don't like to have the id on the form because it looks like the quantity. and people don't want to order 237 of anything.
I have created a css class called NoShow and have set that as the input class.
a little odd having the lookup button followed by the value, but at least the number doesn't show.
Real programmers use copy con newapp.exe

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: lookup button display description
« Reply #1 on: August 29, 2010, 09:21:39 PM »
Hi Chris,

you might want to check out this thread.

cheers
Bruce

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: lookup button display description
« Reply #2 on: August 30, 2010, 04:44:34 AM »
I must be worse off than I thought - um... what thread?
Real programmers use copy con newapp.exe

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: lookup button display description
« Reply #3 on: August 31, 2010, 12:02:44 AM »
Hi Chris,

I'm the bright one in my family... really....

http://www.nettalkcentral.com/index.php?option=com_smf&Itemid=36&topic=1375.0

cheers
Bruce

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: lookup button display description
« Reply #4 on: August 31, 2010, 07:35:24 AM »
I think I did that, but I will open it today and study it.
Thanx
Real programmers use copy con newapp.exe

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: lookup button display description
« Reply #5 on: August 31, 2010, 05:49:26 PM »
For those that are watching this thread - it was the key on the description field!
In order for the description to be used in place of the id, it needs to be a key not sure if it needs to be unique
Real programmers use copy con newapp.exe

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: lookup button display description
« Reply #6 on: August 31, 2010, 09:52:00 PM »
Hi Chris,

No it doesn't have to be unique. However...

One of the features of lookup fields is that you can type in the _description_ and it'll use the description key to lookup the code for you. So although the description key doesn't need to be unique, in most cases you probably want your descriptions to be unique anyway.

Cheers
Bruce


ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: lookup button display description
« Reply #7 on: December 04, 2010, 09:06:39 AM »
Here is a follow up on the display description.
Everything worked out well once the key was in place, but now that it is in production there is a problem - we need allow for multiple records to have the same description. The product is the same but comes from different manufacturers or distributors. The data entry folks see product X but do not get to see where it comes from (this addresses an industry issue involving kick-backs etc) so I can't fiddle the description with a supplier number.
Here is what happens - supplier 1 is out of stock, the data entry person picks the in stock item from supplier 2 and completes the order - when the order gets processed though, it has the item id of the record for supplier 1 :( guess where the order goes? or should I say the back order... hmmm
The fix -
Unchecked the display description,
spanned the prompt,entry and comment
set the comment to choose(ord:invid=0,'Select product from list',p_web.gsv('inv:description'))
set comment comment css to 'Bold'

Real programmers use copy con newapp.exe