Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Exporting report for every occurance as pdf, then sending a custom e-mail with file attached

Featured Replies

Jeeeez guys, when I started meddling with FM, I had no Idea of the vast possibilities it has... Now, I want more and more every day.

Now this is one problem I can't seem to solve so thought you might have some ideas how to do this.

 

This is the situation:

FM 11 on OSX 10.6.8.

Created a database of invoices for my non profit.

As it happens, a lot of people are overdue on their issued invoices.

So I got the idea to create an automated script that will when I activate it create a PDF report containing invoices overdue for every person. And then compile a personalized email that attaches the PDF for that person and then sends it to them.

Simple, ha? Well, I know how to create a report which has one persons overdue invoices on every page when in Preview. But I can't figure out how to make FM export each page by itself and name each file according to the data that person has. Had I managed this I think I could manage to automate the email part of the script, but I got stuck here...

Now, this seems horribly complicated to me, but I guess to someone reading this it could be piece of cake.

So please, if you have the time to suggest a solution, I will be eternally grateful.

I can't figure out how to make FM export each page by itself

 

But you say that the same person can have multiple overdue invoices.  Do you want to save each one of these as an individual PDF and then attach all of them to a single e-mail? The first part is certainly doable, but I think you'll have a problem with attaching more than one file to an e-mail - unless you're using a plugin for this part.

  • Author

But you say that the same person can have multiple overdue invoices. Do you want to save each one of these as an individual PDF and then attach all of them to a single e-mail? The first part is certainly doable, but I think you'll have a problem with attaching more than one file to an e-mail - unless you're using a plugin for this part.

Here is some more info on what I'm trying to do...

The structure is simple. One table containing invoices as records. Each record has these fields, relevant to this operation:

Person (Contains person full name)

Persons email (Obvious)

Invoice number (Contains numbering)

Invoice overdue? (Contains Yes if late)

Invoice amount

So, what I want to do is:

Find Invoice overdue = Yes

Sort by Person

Create report that forms a list of all invoices overdue by each person containing their total summary

Export report for each person to temporary folder as PDF

Email each person an evil sounding email with PDF attached

Loop this through all persons with invoices overdue

Create custom message saying "That's it! Have a nice day!" :)

As said before, each individual segment of this I understand and know how to do. What I don't understand is how to tell FM to loop this for every unique Person name once without naming each person by hand within the script... Especially since I don't want to export each record but rather all overdue records of a unique person.

I see. Before going on, don't you also have a table of Clients where each "person" has a unique record? This would be easier if you had such table, related to Invoices by ClientID.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.