NetTalk Central

Author Topic: Lookup field  (Read 4909 times)

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Lookup field
« on: July 27, 2009, 12:09:59 AM »
Hi,

I have (again) a little problem with the lookup mechanism.
Consider the example data model I attached.
In this model I can have multiple administrations and each administrations has its own set of departments.
When I want to add or maintain a person within an Administration, and I want to select a Department for that person How can I do that usun a lookup button?
Bear in mind that the unique key of the Department table consists of two fields (I need that here) but the lookup field can only contain one value.
I do not wish to use a droplist because the number of departments can grow very large. And I think it is more user friendly this way to show the code (for code minded users).

I'm looking forward to any suggestions.

Rene Simons

[attachment deleted by admin]
Rene Simons
NT14.14

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Lookup field
« Reply #1 on: July 29, 2009, 03:18:16 AM »
Hi Rene,
Why dont you save, in a session value, the Administration and use a browse filtered by that session value to lookup the Department?
Does this helps?
Alberto
-----------
Regards
Alberto

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Lookup field
« Reply #2 on: July 29, 2009, 03:58:14 AM »
Hi Alberto,
Thanks for the sugestion. The point is however that one Dept code can exist in many Administrations and for the lookup I need a unique key. The combi ADM and DEPT is unique.
Over different administrations, the same DEPT code can have different meanings.

Rene
Rene Simons
NT14.14

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Lookup field
« Reply #3 on: July 29, 2009, 04:57:20 AM »
It took me a while but I finally added additional single field unique keys to all my files that had multi field unique keys.

so 1) can you and an additional unique key like ID?

or

2) (you may need the single field unique key) you may get more flexibility coding your own lookup


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Lookup field
« Reply #4 on: July 29, 2009, 07:43:27 AM »
Hi Rene,

you really want single-component unique keys, then this sort of thing becomes straight-forward. NetTalk pretty much requires single component unique keys at this point.

Cheers
Bruce

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Lookup field
« Reply #5 on: July 30, 2009, 04:25:50 AM »
Okay all,

I get your points.
I think I have to get creative at this one.
As soon as I have a solution I'll post it here.

Thanks
Rene
Rene Simons
NT14.14

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Lookup field
« Reply #6 on: August 12, 2009, 06:19:50 AM »
Hi all,

I have done some "creative thinking" and the solution is going to be as follows:
Whenever a new Administration is added to the Administration file, I create a new folder (named after the administrationcode) where a copy of the Department file is created to contain only Department records "belonging" to that Administration.
That will automatically create a unique Key for the code field
Whenever records in the MAIN Department file are created, edited, or deleted, the same operation will be executed to their carbon copy.
The lookup operation will use the copied file with the subset, where the code field will be the unique unchanging key. Redirecting the path for the Department file can be done the way Bruce described in one of the login topics. The Administration code is strored in a session value.
This is all theory of course. I have to find out if and how it will work out but I am optimistic by nature  ;).

Cheers,
Rene

BTW if anyone has a better plan, please let me know.
Rene Simons
NT14.14