3 Replies Latest reply on Oct 13, 2010 8:16 PM by LaRetta_1

    How to show found records from related table?



      How to show found records from related table?


      Table1 with Field1 and Field2 uses Layout1.
      Related Table2 uses Layout2.
      After finding a select number of records in Layout1, how can I show (and use in an email) those found fields in Layout2?

      I tried the the Go to Related Records script step, but without success.
      Found records from Layout1 do not show up in "FoundRecords" field in Layout2, no matter what I try.

      (My database is more complicated, but simplifying it as above will hopefully suffice for this newbie question.)

      Thanks in advance. 

        • 1. Re: How to show found records from related table?

          It helps if you provide real names and details about your file.  Go To Related[] should work fine; what do you mean 'without success'?  Did it switch to Layout2 and produce a found set of records from table2?  If so, it worked.  We need more information ... if the two tables are related, what are they related on?  What is the relationship between them?  For instance, is table1 customers and table 2 invoices or what?

          Until we know whether we are dealing with a 1:n (one-to-many), n:n (many-to-many) or 1:1 (one-to-one) ... and until we know what you are trying to email (example all invoices for a customer to a customer), we can't assist.

          If (for example), table1 is customers that you want to email - and each email should be a customer (listing their invoices from table2), then we need to know that as compared to wanting to send (for example) each invoice in an email.  Here are specifics we need:

          1) What are the names of the tables involved (that usually tells us a lot.
          2) What is the key fields they are joined on? Please tell data type of fields and whether they are indexed.
          3) What are you trying to accomplish
          4) What is the relationship, i.e. is it 1:n (one 'something' with many related somethings?)

          For 'found records from layout1' to show up in layout2, you need to place the fields from table1 on a layout from table2.  With more information, we can help you through this. :^)

          • 2. Re: How to show found records from related table?

            I am not able to properly describe things, suffice to say its the first table contains over 1500 contacts, the second table has no records yet.

            My intentions were to:

            1. Find a group of contacts in Table1, then

            2. Execute a script from Table1 that would capture the Name, Company and Email fields, then create a new record in Table2 (with a scrolling non-editable text field that simply shows those found contacts - just for the user to see).

            The Table2 layout would also have email subject and email body fields as well as a couple of containers for attachments. Then

            3. Generate the email (which commits the new record in Table2) and send to those found from Table1 

            The relationship between the two tables is not yet defined. I'm not even sure they need to be related...?

            Apologies, for the non-programmer speak.

            Any assistance greatly appreciated.

            EDIT: The purpose of the second table is to keep a record of all the emails sent (with referenced attachments) and to who.

            • 3. Re: How to show found records from related table?

              You are being assisted on FM Forums by the best Developer in this business.  Follow his suggestion and you will get exactly what you need.