Alpha Video Training
Results 1 to 7 of 7

Thread: Problem with lookup in line detail

  1. #1
    Member smrogers's Avatar
    Real Name
    Shawn Rogers
    Join Date
    Feb 2006
    Location
    Reading, MA / 15 Miles North of Boston
    Posts
    516

    Default Problem with lookup in line detail

    Hi,

    I think I have a unique problem, and can't figure out how to handle it.

    The invoice header section is standard -- invoice #, customer #, date, etc. However, the product lookup in the line detail section is causing headaches. Specifically, I need to be able to do a lookup that restricts the products shown in the lookup based on the customer number. Each customer has an assigned group of inventory they can purchase, based on customer number (each produt code starts with the customer number).

    I'm a newbie who is trying to learn fast, but this roadblock has me stumped. I'm not sure if I am indexing things properly or what, and am not sure what to do in the lookup section of the field rules to get this to happen. Any help would be appreciated.

  2. #2
    Member
    Real Name
    Daniel Weiss
    Join Date
    May 2000
    Location
    Monsey, NY
    Posts
    506

    Default

    A simple way to do it would be if you add the customer id field to the invoice items table
    And put this script on the “OnEnterRecords” events
    Code:
    t1 = table.get("invoice_header")
    t2 = table.get("invoice_items")
    t2.Customer_Id = t1.Customer_Id
    And then add this filter to the lookup for the product id
    Code:
    left(Product_Id,len(invoice_items->customer_id))=invoice_items->customer_id
    Daniel Weiss
    EZ Link Software

  3. #3
    Member smrogers's Avatar
    Real Name
    Shawn Rogers
    Join Date
    Feb 2006
    Location
    Reading, MA / 15 Miles North of Boston
    Posts
    516

    Default

    Thanks Dan -- I'll try that out tonight!

  4. #4
    VAR
    Real Name
    Cheryl Lemire
    Join Date
    Jul 2003
    Location
    Pembroke Pines, FL
    Posts
    2,914

    Default filter your table lookup

    You can also use a filter in the field rules:

    http://support.alphasoftware.com/alp...d_Lookups).htm

    Good luck
    Cheryl

  5. #5
    Member smrogers's Avatar
    Real Name
    Shawn Rogers
    Join Date
    Feb 2006
    Location
    Reading, MA / 15 Miles North of Boston
    Posts
    516

    Default Problems with the filter

    Hi Dan,

    The first part of the equation worked great. The customer Id fills in on the detail just fine. Let me explain what is going on now;

    First, to simply my original question, I framed it as a typical invoice situation.

    Actually, it's similar but a different application - These are timecards that are entered in on a weekly basis. The "cards" are the same as an invoice. The detail is the time for each employee (the customer). Each employee has a variety of jobs they perform, each of which has a different pay rate. There is a table which contains the employee number, the code for the job, and a rate. This table is the "products" table.

    So, each "invoice" (or paycard) has multiple jobs entered for the employee,
    with multiple line items.

    I've got the set defined as follows: The header is the parent, with the detail as a one-to-many child with referential integrity. The paycode table (products) is a child of the detail, one-to-one. When I go to setup the lookup for the detail paycode, I have the paycode table as the lookup, with the linking field being the paycode #. However, when I create the filter, the expression builder only shows me fields from the lookup table... it won't let me enter in the matching field from the detail....

    Do I have the set configured wrong, or do I need to define other keys? Thanks for any other insight you can give me.

  6. #6
    VAR
    Real Name
    Cheryl Lemire
    Join Date
    Jul 2003
    Location
    Pembroke Pines, FL
    Posts
    2,914

    Default try this: paycode=cards->paycode

    Shawn,

    Try this for your filter: paycode=cards->paycode

    paycode is field name in lookup table

    cards-> table name of header/parent table you are doing the lookup from
    paycode is field name in the table you are doing the lookup from

    Hope that makes sense.

    Cheryl

  7. #7
    Member smrogers's Avatar
    Real Name
    Shawn Rogers
    Join Date
    Feb 2006
    Location
    Reading, MA / 15 Miles North of Boston
    Posts
    516

    Default Great

    Cheryl & Daniel -- Thanks so much! The combination of your efforts has solved this problem, and I'm on to the next! I appreciate your kind efforts! Alpha has a lot more going for them than just their software -- the users who are so helpful in this forum!

Similar Threads

  1. Lookup in Detail Enter supported?
    By Pat Bremkamp in forum Web Application Server v7
    Replies: 2
    Last Post: 02-18-2006, 07:39 PM
  2. First Report Detail Line Different Size
    By John Oesterle in forum Alpha Five Version 5
    Replies: 6
    Last Post: 01-30-2006, 01:05 PM
  3. Detail record and gridlinker problem
    By Brett in forum Web Application Server v6
    Replies: 1
    Last Post: 07-05-2005, 06:45 PM
  4. Report detail section spacing problem
    By Mike Vance in forum Alpha Five Version 6
    Replies: 16
    Last Post: 02-09-2005, 09:24 PM
  5. Report Detail columns problem
    By Dick Blanchard in forum Alpha Five Version 5
    Replies: 5
    Last Post: 01-23-2004, 12:55 PM

Bookmarks

Posting Permissions

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