Announcement

Collapse
No announcement yet.

Drill down through table using related fields

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Drill down through table using related fields

    Folks,

    I have a MySQL table and grid in ScriptCase 8.1. The table has related fields such that records have a field in common. Their are a number of fields overall, but there are 2 fields (record_ID and related_record_ID) such that many records may have the same related_record ID. I want the user to be able to navigate the grid such that when he clicks on a record, the grid will display records that have the same related_recordID). He can do this repeatedly, drilling down through the table. I need the user to be able to use the other grid features such as the various searches and sorts of typical ScriptCase grids.

    I would appreciate suggested approaches/ways to accomplish this.

    Thank you.

  • #2
    Add to your SQL on grid
    PHP Code:
    WHERE [related_where
    Now, create a field link calling the grid using this same field as param.

    And on your onLoad for example do something like:
    PHP Code:
    [related_where] = ([related_where] != '' ? [related_where] : '1=1' ); 
    If your grid is called first time, will load all records. When you click a field, Grid will filter to this related_records.
    /Giuseppe

    Professional Scriptcase Services
    Some Customers opinions

    Comment


    • #3
      Hi Giu,

      I was out for a bit and now saw your suggestion. Much appreciated!!! I will try shortly.

      Best,

      Lyle

      Comment


      • #4
        Hi Giu,

        I'm having a little trouble following your instructions. I'm hoping with the information below you could possibly make it specific to include my actual table fields.

        table name is: cp5sql and is a MySQL table
        the idea is that when the user clicks a record, the content of field {urootoffset} of that record becomes the content of the {uoffseta} field of the records to find and display.

        Both fields are Varchar(9).

        Also, what will make the field clickable?

        Thanks so much!!

        Comment


        • #5
          table name is: cp5sql and is a MySQL table
          the idea is that when the user clicks a record, the content of field {urootoffset} of that record becomes the content of the {uoffseta} field of the records to find and display.
          Sorry, don't understand.

          Also, what will make the field clickable?
          Create a new link of type field.
          /Giuseppe

          Professional Scriptcase Services
          Some Customers opinions

          Comment


          • #6
            Hi Giu,

            When I create a field link, I don't see how to link to the same application. If I understand I would be creating a link within the same application since I want to link to a record in the same application.

            Comment

            Working...
            X