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.

Printing From related Tables

Featured Replies

I have a "Master Record" with 4 portals on it. Each of those portals is related to the Master Record by a UniqueID to the Master.

Depending on the users needs at data entry time, anywhere from 1 to 4 of the portals may need to be populated during the data entry event.

I would like to have a script that will when activiated look at each portal/table and if a related record (to the master)has been created, switch to the appropriate layout and print it. If no related record has been created move to the nextportal/table and perform the same check and then exit after the last portal is checked.

Each Master Record would always have at least one Portal Row Populated, so the print result would always be at least one page and could be many more depending on how many portals rows are populated in each individual portal.

I have two issues I don't know how to resolve: the first is getting past the "no records found" message if any of the portals don't have a related record, and 2, how to loop this type request.

I think I could do a work around whereby everytime I create a Master Record a related record is created in each portal and only populated with the UniqueID in the fkID field. Then, I could write a script with an "if Not(IsEmpty)" pointed to any other unpopulalted fields to determine if a page prints.

The only thing I don't like about that is it potentially creates a bunch of empty records in the related portals. However...and forgive me for rambling...the user would never see the empty records except for the unpopulated portal in the Master Record. So maybe that is not such a bad thing? It certainly gets me past the "no records found." And that loop I know how to write. I was just thinking...I could probably back in after the print routines and then delete the unused records in the related portals.

Does anyone have a more elegant suggestion/solution for how I can pull this off?

Thanks in advance for any help,

Steve

To seee if a portal has any records in it, you can use the Count() function. Be sure to count a related field that will always have something in it, like a remote key for the relationship.

Count( relationship1::keyfield )

Your script would have If conditional statements looking at each relationship.

If [ count( relationship1::keyfield ) > 0 ]

Go to Layout [ layout for portal 1 ]

Print []

Go to Layout [ original layout ]

End If

If [ count( relationship2::keyfield ) > 0 ]

Go to Layout [ layout for portal 2 ]

Print []

Go to Layout [ original layout ]

End If

If [ count( relationship3::keyfield ) > 0 ]

Go to Layout [ layout for portal 3 ]

Print []

Go to Layout [ original layout ]

End If

If [ count( relationship4::keyfield ) > 0 ]

Go to Layout [ layout for portal 4 ]

Print []

Go to Layout [ original layout ]

End If

This script will give you a print dialog for each layout, and it's by no means complete, but it illustrates the concept.

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.