coffeec Posted August 11, 2005 Posted August 11, 2005 I have a button that takes the user from LayoutA to LayoutB based on the script Go To Related Record. But, when there is no found set, it doesn't do anything. I tried using IsEmpty and RecordCount = 0 to try to catch the error so that I can bring up a custom dialog box but can't seem to get it to work. Is there another way of making the dialog box popup when there are no records in the foundset.
Ender Posted August 11, 2005 Posted August 11, 2005 The behavior of the Go To Related Records[] script step has changed in FM7. Now, if there are no related records, the found set remains unchanged. To deal with this, you should test for the presence of related records before performing the GTRR step: If [ Relationship::RecordID ] Go to Related Records [ Relationship ] Else Show Custom Dialog [ Message ; "No related records." ] End If
coffeec Posted August 11, 2005 Author Posted August 11, 2005 Really strange. I setup the script like you said and when there are related records, it still evaluates to true and shows the related records but for some reason, the else statement still does not work and no custom dialog box appears. Can you tell why this could be because the logic is right but I don't get it.
Ender Posted August 11, 2005 Posted August 11, 2005 ...I setup the script like you said and when there are related records, it still evaluates to true... This should be the case. If there are related records, then the first related record will have a record ID>0, and the If[] evaluates to true. The Else part only evaluates if there are no related records.
coffeec Posted August 11, 2005 Author Posted August 11, 2005 Thanks for your help. I was setting up the if statement wrong. I was using If[Table1::IDField1] but then I realized that this would alwys evaluate to true so then I realized that the proper if statement should be the following If[Table1::IDField1 = Table2::IDField2].
Ender Posted August 11, 2005 Posted August 11, 2005 Same thing: If [ Table2::IDField2 ] Go to Related Records [ Table2 ] ...
PatriciaW Posted August 16, 2005 Posted August 16, 2005 (edited) I have a similar problem. I have two layouts. One is used purely to find a record (or set of records. Afterwards a script takes the user to a layout where they can update the selected record. I understand that GTRR doesn't work with the separation model. If this is correct, then what is the best way to do this? Edited August 16, 2005 by Guest
Recommended Posts
This topic is 7041 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