Jump to content

Print related records


ssseeesss

This topic is 5251 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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.

Link to comment
Share on other sites

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")

}

Link to comment
Share on other sites

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
Link to comment
Share on other sites

This topic is 5251 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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