1 2 Previous Next 21 Replies Latest reply on May 3, 2014 4:27 AM by AndreasDartmann

    Email multiple records in portal

    JillX

      Title

      Email multiple records in portal

      Post

      I am working on portal and want to save and email all records in a portal, I tried with LOOP, but there seems an error in logic, I appreciate any help and advice you have on this problem.

      Thank you!

        • 1. Re: Email multiple records in portal
          philmodjunk

          You'll need to describe what you are doing in more detail. A portal indicates that you have at least two tables with a relationship. You'll need to describe that relationship and then also describe in what form you want to email those records as you might email them as

          1) an attached pdf report

          2) text included in the email body that lists the data in the portal

          3) as a snapshot link (Requires that the recipient have access to your database)

          • 2. Re: Email multiple records in portal
            JillX

            I have table Order and Lists, and I put my portal in table Order. Those two tables are linked with field FC. FC=FC is the relationship. And creation in table List can change table Order.

            In portal of table Order, I enter data and data will demonstrate on table List. Now I want to read all rows in Order portal, and email with text. I know how to email with text, but I have problem writing script to read all rows of records in portal. Model is the field in table List that I want to read and mail.

            This script only read first line of portal record:

             

            Go to Portal Row[ Select; first]

            Loop

               Set Variable[$$Order;Value:List::Model]

               Go to Portal Row[select; Next; exit after last]

               Set field[Order::Model;$$Order]

               New Record/request

               Go to field[Order::Model]

            End Loop

             

            Thank you!

            • 3. Re: Email multiple records in portal
              philmodjunk

              If you want to see this in the body of your email:

              Model a
              Model b
              Model c

              where each row is a single field in your portal, you can use the list function as part of the calculation for the body of your email:

              List ( List::Model )

              No need for a script and I don't see any reason to create new records just to get a list to send out as part of your email. (New record in your script is creating new Order record each time and this keeps it from getting past the first portal row as this takes you to a new record with what is most likely an empty portal. Then go to portal row exits the loop.)

              • 4. Re: Email multiple records in portal
                JillX

                Thank you so much Phil! That's exactly what I want to do.

                I have another question: There are quantity data regarding to each model, how can I send email like this:

                Model  a  Quantity 1

                Model  b  Quantity 2

                Model  C  Quantity 3

                 

                Or there's other ways I can do?

                 

                Thanks!

                • 5. Re: Email multiple records in portal
                  philmodjunk

                  In the list table, define a calculation field that combines the data the way you want to see one row of data in your email. Use the list function to list this calculation field.

                  • 6. Re: Email multiple records in portal
                    JillX

                    Thank you so much Phil! It works perfectly!

                    • 7. Re: Email multiple records in portal
                      JillX

                      Hello Phil,

                      I got another question: I want to add contacts and record the date I enter those contact. It will look like this:

                       

                      Contact 1   Contact 2    Contact 3

                      Date 1        Date 2        Date 3

                       

                      How can the date update automatically when I enter contact, and date1 will not change when I enter later contact?

                      Best!

                      • 8. Re: Email multiple records in portal
                        philmodjunk

                        I'd use a related table of records for this. One record for each contact and date pair. The date field can then be set to auto-enter the date created or date modified.

                        • 9. Re: Email multiple records in portal
                          JillX

                          what if they are on the same table?

                          • 10. Re: Email multiple records in portal
                            philmodjunk

                            It makes it harder to work with them where it is very easy to do if they are in a related table.

                            If they are in the parent table, you'd need to use a less flexible method for storing multiple dates and contacts.

                            You might use a series of individual fields, a pair of repeating fields or text fields with values separated by returns.

                            Non of which are as simple or as flexible as using a portal to a related table where each record has a contact field and a date field.

                            • 11. Re: Email multiple records in portal
                              JillX

                              Oh, I see. I will try with related table.

                              Back to my earlier question, what if I want to save model and quantity date from Order table to another related table in certain fields?

                              Thank you so much for your patience and excellent advice!

                              • 12. Re: Email multiple records in portal
                                philmodjunk

                                what if I want to save model and quantity date from Order table to another related table in certain fields?

                                Can you post an example of what you want to do and why? (Knowing why sometimes helps me to avoid suggesting something that meets the immediate request but fails to reach the ultimate goal of what you are trying to do.)

                                • 13. Re: Email multiple records in portal
                                  JillX

                                  I want to maker order from Order table with portal, and want to save those records so that I will have a backup for order history and detail information.

                                  In table Order, I use portal to enter data and run calculation through related table List. Then I want to save information in portal to related table Records to build an archieve for order history.

                                  • 14. Re: Email multiple records in portal
                                    philmodjunk

                                    Don't you keep that data in your order table and related tables? Why do you need a separate "history" table?

                                    I think you need to layout what tables you have dn the function of each. A typical invoicsing system is built around these relationships:

                                    Customers----<Orders------<LineItems>------ProductsAndOrServices

                                    Does this match what you have?

                                    1 2 Previous Next