steigrafx Posted January 27, 2012 Posted January 27, 2012 I have a script to Go To Related Record: Open File ["Electronic Recording"] Go to Related Record [show only related records; From table: "Electronic Recording Proceeding"; External; Using layout: <Current Layout>] (If I don't use the Open File step, the file opens at 100% zoom, which is not the zoom level I want.) Here's my question. When the script runs and no related record exists, the result is an empty record. Is there a way to make a custom dialog appear saying no related record exists, and then an "OK" button to close the file? Thanks, Kevin
Fitch Posted January 27, 2012 Posted January 27, 2012 You can either test for related records first, or attempt to GTRR and trap for the error. If[ IsEmpty( related::field ) ] // show dialog or whatever End If vs. Set Error Capture ( On ) Go to Related Record [ ... ] If[ Get(LastError) <> 0 ] // show dialog or whatever End If I remember recently discussing whether one way was preferable, but I can't locate the discussion at the moment. I usually do it the first way because it's simpler, but it seems to me that somebody had a reason to prefer the latter method. Can anyone remind me what that reason might be?
steigrafx Posted January 28, 2012 Author Posted January 28, 2012 Thank you, Fitch. I used your second suggestion and it worked perfectly. Thanks for saving me from a few more grey hairs. Kevin
Recommended Posts
This topic is 4684 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 accountSign in
Already have an account? Sign in here.
Sign In Now