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.

Print related records

Featured Replies

I have a database with two tables: People and Activities. I want to print the detail of a person and it's related activities.

I could make a really large portal for the activities table and use print sliding. I don't like this because the number of records in the activities table is not predictable.

I ended up making a list layout from the activities table and using GTRR script step to pull out all the related activities. It worked out really good whether there were one or 1000 activities.

The only problem is that when the person has no activities. The GTRR script gave an 101 "record is missing" error and the printing was broken up.

Is there a way to get around this problem? When there is not related record, just leave that empty and make the rest print out correctly.

Hi,

You will need to handle this printing of activities carefully.

For a people record

Go to layout (people)

Go to related (activities)

If(get(lasterror =0)

{

Go to the list layout and print them all

}

else

{

go to layout (People)

Show custom dialog ("There does not exists any activites for this person")

}

  • Author

thanks for the reply.

I came up with my own solution. I temporarily attached an empty related record before printing and removed it right away after the GTRR script step. It worked for me.

What? Why did you need a temporary related record?

Pushkraj's script is fine. If there are no related records, FM throws an error. His script checks for the error and not getting one (Get (LastError) = 0) goes to the related records. That works.

Another way is to check for related records, and if there are any, gtrr. I use the construct:

If (not isempty ( relationship) )

gtrr

Else

Show Dialog, "No related records" )

End If

Edited by Guest

His script checks for the error and not getting one (Get (LastError) = 0) goes to the related records.

If there's no error, wouldn't you already be there?

True! Oh, you're so much more careful a reader than I am.

So, use my method and check the relationship, if it exists, then gtrr.

Being a "careful reader": you should check for the existence of a related record, not the relationship:

If [not IsEmpty ( Activities::PersonID )]

Go to Related Record [ ... ]

Else

# DO SOMETHING ELSE

End If

Well, if I was a more careful WRITER, I would have said check for the existence of a related record, which is precisely what I'm doing.

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.