6 Replies Latest reply on Mar 14, 2013 3:26 PM by FilmUser

    Send email script using 2 data bases

    FilmUser

      Title

      Send email script using 2 data bases

      Post

            

           I have 2 data bases, hosted from the same folder in the same server, but unrelated (but could be if needed for this problem).

           One is Contacts, the other "Messages".

           I have scripts in Contacts which send mail to a found set (keeping each set small enough to stay under the spam radar.)

           The values for the Subject line and Text content email are in the Messages data base each in their own fields.

           All emails are sent on the same day of the week, every week (Tuesday) and the subject line and text content are the same for all of the emails, per week.

           If the send email script is in the Contacts data base, I can't seem to direct the script addressing window to pick up the values for the subject and text content from the other data base.

           My ultimate plan is to sequence the scripts to run as one.

           I have Filemaker 10 and 11 on different machines on the network, and Advanced 11 available on another, if needed.

           Any ideas? (I'm not a seasoned developer.)

        • 1. Re: Send email script using 2 data bases
          philmodjunk
               

                    If the send email script is in the Contacts data base, I can't seem to direct the script addressing window to pick up the values for the subject and text content from the other data base.

               Is explained by this:

               

                    I have 2 data bases, hosted from the same folder in the same server, but unrelated

               The whole point to using a relational database is to be able to link data in one table to data in a different table. Just from the info posted here, there is no good reason not to have both tables in the same file--which would make working with this issue a little bit easier.

               Whether you do that or not, you will need to define a relationship that allows you to pull up your contacts records in a found set and link them via a relationship to a specific message record in the messages table.

               One Possibility:

               Contacts::gMessageID = Messages::__pkMessageID

               gMessageID would be a field with global storage specified and you'd format it with a drop down list of Message ID's from __pkMessageID and also the subject line text or other such text field so that you can tell which message record is which when you select from the value list.

               For an explanation of the notation that I am using, see the first post of: Common Forum Relationship and Field Notations Explained

          • 2. Re: Send email script using 2 data bases
            FilmUser

                 Thank you for this, PhilModjunk. I tried to relate them earlier and for some reason, when trying to add the database as a source (while both are being hosted), I see the database, but no tables in the panel, and so I can't add the data base to create an occurance in the relationship graph of the Contacts database. 

                 Do I need to close them both (with the console), then take copies of them onto my own computer, make the relationship, then re-import them back to the server?

            • 3. Re: Send email script using 2 data bases
              philmodjunk

                   That would be safer, but it is not strictly necessary. Making structural changes in your data model while hosting the database can lock all your users ouf of the database while committing the change--possibly in the middle of a script and network "hiccup" during the commit can result in a damaged file.

              • 4. Re: Send email script using 2 data bases
                FilmUser

                     I am working on these, they are not yet deployed, but I still can't see the tables within the Messages when trying to create the occurance in Contacts relationship graph. Why would this be?

                     It doesn't matter whether I have the Messages open or not when trying to make the relationship in Contacts.

                • 5. Re: Send email script using 2 data bases
                  philmodjunk

                       Please note:

                       

                            a network "hiccup" during the commit can result in a damaged file.

                       This is true even if you are the only person accessing the file.

                       I see no reason from here why you cannot get a list of tables from which to select when adding a new table occurrence.

                       Make sure you are accessing the correct file. If it's hosted over the network, use the Remote button. Make sure that this is not an "Interface" file with the tables present in another file. Make sure that access permissions on the Messages file combined with an automatically entered password aren't restricting your access--but if this were the case, I'd expect to get an error message telling me that my privileges don't permit the action.

                  • 6. Re: Send email script using 2 data bases
                    FilmUser

                         Thanks for this, I'm coming and going on this project. (non profit).