5 Replies Latest reply on Mar 1, 2013 10:56 AM by philmodjunk

    sending an email based on a field value

    jmorales

      Title

      sending an email based on a field value

      Post

           I would like to send an email to a user based on the value of a field in the layout.  I have a layout with a field "assigned_to".  when this field is populated with a value from a list, I want an email to to be sent.  This field can have up to 10 choices of names to choose from, these names are staff names each with it's own email address.  Any ideas?

           Thanks,

        • 1. Re: sending an email based on a field value
          philmodjunk

               And where do you store your names and email addresses? If you put then in a related table such that selecting a recipient in the assigned_to drop down links the current record to the related record for that recipient, you can use the field option to specify the email address in that related table of recipients.

          • 2. Re: sending an email based on a field value
            jmorales

                 I have a staff table with a primary key "Staff_ID", and Lname, Fname and email.  So If  I create a relatiion between "assigned_to" in my ticket table and Staff_ID in my staff table then how do I make it send an email when the Satff_ID is selected from the list?  I'm having trouble making this connection.

                 I would like for the email to be sent on commit, but how do I do that? do I have to create a new field for emails and use a script ? I'm not clear on what's the best way, or I'm completely lost.

                 Thanks for responding.

                  

            • 3. Re: sending an email based on a field value
              philmodjunk

                   If you are using FileMaker 10 or newer, you can use the OnObjectSave script trigger to perform you email script when you select a staff_ID in the Ticket table.

                   This assumes that you have the following relationship:

                   Tickets>------Staff

                   Tickets::Assigned_To = Staff::Staff_ID

                   and that Assigned_TO is formtted with a pop-up menu or drop down list using a value list that enters Staff_ID into Assigned_To. (You may need to define a text field in Staff that uses an auto-enter calculation to combine first and last names so that you can use it as the secondary field in the value list.)

              • 4. Re: sending an email based on a field value
                jmorales

                     Thanks, a lot for your help on this.  It seems like I have to have two fields to handle the "Assigned_to"; I currently have the field "Assigned_to" with a drop down list of staff_ID's from the Staff::Staff_ID table.  This is a number, but I need it to show an actual name, so I need to add a second field to hold the calculation of Name = FName & " " & LName, from the Staff table, Correct?

                     Thanks again.

                • 5. Re: sending an email based on a field value
                  philmodjunk

                       YOu don't need that calculation field. Just add the name field or fields from Staff to your layout.