1 Reply Latest reply on May 3, 2010 11:09 AM by philmodjunk

    Perform Find of All Records with Related Field

    TSADesign

      Title

      Perform Find of All Records with Related Field

      Post

      I have a table that includes a field called Connector ID. For each Connecter ID there is a related Contact ID, for each Contact ID, there is related data. The same Connector ID may have several Contact ID fields. So to try to explain, my table would look like this:

       

      Connector ID                    Contact ID                Available Stock               Contact Price

      AABBC                                 11223                              25                                      $.25

      AABBC                                 11224                              50                                      $.35

      AABBC                                 11225                              30                                      $.15

      AABBC                                 11226                              22                                      $.05

      AABBC                                 11227                              10                                      $.55

       

      I'm performing a Script in Layout A that triggers the following script from a PopUp Menu:

      Enter Find Mode [Pause]

      Set Field [Connector Specs::Connector Selector]

      Set Error Capture [On]

      Perform Find []

      Set Error Capture [Off[

       

      In this script Connector Selector is a Global field that contains a PopUp Menu of data found in Connector ID. Upon execution of this script, there is a second script that takes the user to Layout B where data related to the selected Connector can be found, to include a picture and other related data.

       

      Here is my issue (finally) how can I get all related Contact ID data to appear in the new Layout? Is this something that I would use a Portal for, and if yes, how would it work?

       

      In short, if in the field Connector Selector the user selects Connector AABBC, I need all related Contacts (11223, 11224, 11225, 11226, 11227) and related data to appear. The related data is Available Stock and Contact Price  of each contact to appear in the new layout.

       

      To further complicate the issue, some Connectors my have 20 related contacts, others may only have 5. I would like to have a table that is dynamically built based upon the number of available options to keep it cleaner.

       

      I know this is an incredibly long post, but I would appreciate any help anybody can offer.

       

      Thank you,

       

        • 1. Re: Perform Find of All Records with Related Field
          philmodjunk

          I see some problems with your script:

          Enter Find Mode [Pause]  //I don't see a reason why you would have your script pause in find mode like this

          Set Field [Connector Specs::Connector Selector]   // You are missing your first parameter here I should see something like:

          Set Field [YourTable::Connector ID ; Connector Specs::Connector Selector]

           

          Perhaps those were just types when posting your script.

           

          Once you have found the record specified in Connector Specs::Connector Selector, you can display the related table in a portal. You can enable the scroll bar to make sure that all related records can be viewed edited.

           

          You could also use the value in your global field to search the related table of records by switching to a layout based on the related table and performing a find on that table. The layout could be designed for table or list view to let you see all the related records in a group. You can place fields from the parent table in the header if you need that data to be available.