Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

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.

Posted

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

}

Posted

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.

Posted (edited)

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
Posted

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.

Posted

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

Posted

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.

This topic is 5441 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.