Alpha DevCon 2018
Results 1 to 4 of 4

Thread: Lookup and fill field from fields

  1. #1
    Member
    Real Name
    Norman Lok
    Join Date
    Mar 2010
    Posts
    28

    Default Lookup and fill field from fields

    Consider dataTable has field "fullname"
    ,staffTable has fields "firstname" and "lastname".

    I want to lookup and fill dataTable.fullname with staffTable.firstname and staffTable.lastname

    What A5 can do is fill "fullname" with "firstname" or "lastname"

    Can I override and fill "fullname" with own formula?

  2. #2
    "Certified" Alphaholic
    Real Name
    Frank Bicknell
    Join Date
    Feb 2010
    Location
    39.1915° N, 84.4348° W
    Posts
    2,409

    Default Re: Lookup and fill field from fields

    If you are using a SQL data source you could concatenate the names in the select statement. Like select firstname + lname as fullname. Then fill with fullname = fullname.

  3. #3
    Member dickerman7239's Avatar
    Real Name
    Kim Dickerman
    Join Date
    Nov 2008
    Posts
    92

    Default Re: Lookup and fill field from fields

    What are you working in A5/dbf or A5/SQL? And what do you want to do with the new field once you have it, grid display only, grid display and report definitions, or report definition only?

    I've done this a number of different ways so I think it boils down to how you will be using the new field. As mentioned by Frank, I do the concate function in SQL knowing that I will be referencing the field via a view for grid and report definitions in A5. You can also create a calculated field using the different trim functions that works nicely.

    For grid display only you can simply merge the first and lastname fields in the grid definition. For reporting maybe a Rich Text field will be more appropriate.
    Kim Dickerman

  4. #4
    Member
    Real Name
    Norman Lok
    Join Date
    Mar 2010
    Posts
    28

    Default Re: Lookup and fill field from fields

    Thanks frankbicknell and dikcerman.

    I am using mySQL database
    and an update-able grid to modify table "dataTable"
    For demo purpose, this table only got one field "fullname"

    Another table "staffTable" has "firstname" and "lastname".
    The lookup and fill function provided by A5 is working for one-to-one mapping.
    That is firstname==> fullname, or lastname==>fullname.

    Frank's way is to create a new lookup grid component that use select statement to concatenate both firstname and lastname. Then we can define lookup field base on this new grid.

    It works.

    Cause I want to make a persistent lookup all over my project on staff table.
    I wonder if only show firstname, lastname on this lookup grid and hide the concatenate fullname.

    Regards,
    Norman

Similar Threads

  1. Lookup and Fill-Fields Action Javascript
    By Toby Locke in forum Application Server Version 10 - Web/Browser Applications
    Replies: 1
    Last Post: 01-15-2010, 02:23 PM
  2. Fill hidden field from lookup
    By Pat Bremkamp in forum Archived Wishlist
    Replies: 3
    Last Post: 11-06-2009, 04:40 AM
  3. Is lookup the right choice to select & fill fields with 2 fields
    By MikeData in forum Alpha Five Version 9 - Desktop Applications
    Replies: 13
    Last Post: 01-10-2009, 04:21 PM
  4. A5, V4.5, do not fill all the fields in table lookup
    By jrtarrago in forum Alpha Five Version 4
    Replies: 3
    Last Post: 11-10-2008, 03:08 PM
  5. Lookup table and fields to fill
    By rleunis in forum Alpha Five Version 6
    Replies: 1
    Last Post: 09-16-2005, 03:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •