Jump 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.

Mail Merge from a portal

Featured Replies

confused.gif

I have a main database that contains business address information of on it. There is also a portal that displays names associated with the business. I want to print a form letter to each of the names in the portal with the appropriate business address on each letter. Right now I can only print one letter of the first name of each business, no matter how many names are associated with it. I know I can print the letters from the names database but then I would have to select each business at a time and print the letters. What I really want to do is print letters to all the names of all the businesses residing in a certain zip code, say, or all the franchises of a fast food chain on the database. How can I do this?

You should be printing from the related file, not the parent file. You can create a reverse relationship from the child file back to the parent file in order to retrieve the business name and address fields.

  • Author

Wow, that's not very elegant at all. Having to select the records in one file and go to another file to print the stuff you want is pretty lame. I don't want my users to have to do all that. Any other suggestions? How about a script?

Thanks.

The MadJammer

Yes, you should have a script to do this. A script in the main file calls a script in the related file to do the printing. The user need not ever see the related file. So it's not really all that lame. Most of the information you are printing is in the related file, and you can place summary parts wherever you need them to show totals etc.

  • Author

So from all this I gather that I could construct a dropdown box or an array of buttons or some some other device on the main file that would contain all the layouts that are available from the related file and then run a script for whichever report was selected. Could I have just one script, we'll call it PrintReport, and send it the selected report name as a variable or argument? This would eliminate the need for multiple scripts that are all the same except for the report name they are executing.

Also, can I populate the dropdown box or an array of buttons so that the available reports from the related file are listed? How can one tell the difference between a report layout or a regular layout when populating a dropdown?

Thanks

Jeff(The Mad Jammer)

P.S. Bob, don't eat brains. You might get Mad Cow disease.

Yes you can do it with one script.

First, the best way to transfer data between different files is to set up what is called a constant relationship. Create a calculated field in each file called Constant with the formula:

1

So, its value in every record will be 1.

Then create relationships between all files that need to pass data, based on this Constant field. Once you have done this you can access/change the contents of any global field from any file in which you have set up this relationship.

So, in your main file you can have a global called gSelectedReport that contains the name of the report that the user has selected. Then the related can access it with the syntax: ConstantRel::gSelectedReport.

You can get a list of all layouts from the related file into the main file with the design function LayoutNames(). A quick way to turn this into a popup menu is to make a stored calculated field cReportNames in the main file with this formula:

LayoutNames("RelatedFileName")

Then define a value list using values from the field cReportNames.

There are a number of ways of doing this. This one may not be the most efficient, but it's the easiest to explain and to set up.

  • Author

cool.gif Yehaw, we is a computin' and cipherin' now.

Seriously, I'll give that a try when I have figured out what you just wrote. There's a lot of information there 'eh?

Jeff (The Mad Jammer)

'eh?

Don't be makin' fun aboot my Canadian way of talkin' or I'll come oot there and kick yer behind.

  • Author

Come on down. The weather is great.

Create an account or sign in to comment

Important Information

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

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.