1 Reply Latest reply on Mar 22, 2011 1:45 PM by philmodjunk

    Help Writing a Script for Emailing

    Esu7

      Title

      Help Writing a Script for Emailing

      Post

      Hi,

      I am really new to FileMaker, & I was wanting to create a database for Absence for my company.  Now one thing I would like to do is in the Name field have everyones name in there & they just have to find their name and click on it.  Now here comes the tricky stuff, as soon as the person picks their name the database automatically knows the supervisor to send it to.  Is there a way to write a script that when you click on the Email Button it will automatically put in the supervisor's email address. (NOTE: There are serveral different departments in the company I work, & each depart has their own supervisor.)

      One more thing I would like to see if it is possible, & if yes how to do it.  In this same database I want to have a button that says Accept, & if it was Clicked it will automatically deduct, say sick time, from that person's available sick time allowed.  Then I would like it then to send an email back to the person asking for the time off.

        • 1. Re: Help Writing a Script for Emailing
          philmodjunk

          Ok, you are new to FileMaker, but how new are you to database design and/or programming/designing in other computer venues?

          You can set up 2 or possibly three tables with relationships. Keeping it to two tables for now:

          Employees>-----Departments     ( ---< means one to many )

          Employee::DepartmentID = Departments::DepartmentID   (Departments::DepartmentID should be an auto-entered serial number)

          You can define a supervisor email field in departments and your Send Mail dialog (You'd use this in a script) can then simply refer to Departments::SupervisorEmail for the To box in this part of the email set up.

          It's also possible to simply put all your supervisors in the Employees label, add a 2nd table occurrence of Employees, named Supervisors which I'd link to a Departments::SupervisorID field, but let's stick with a simpler structure to get started.

          If you have not already done so. Please look up Send Mail in FileMaker help and make sure that you can select Send Mail from the File Menu and use it to send an email to yourself. This test will confirm that you have a compatible Email account that you can use with FileMaker and that it is configured correctly.

          After you get these initial steps working to your satisfaction, you may want to make a new post with your follow on questions where you spell out the structure of your data base in more detail. You can certainly add such a capability, but the exact details depend on the design of your database.