Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

"Go to related record" after deleting current record?


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

Recommended Posts

  • Newbies
Posted

Hello,

I'm very new to FM although I do have extensive SQL skills(maybe that's why I'm not really getting anywhere with FM).

Anyway, I have a database with a Parent-Child(one-to-many) relationship between two tables, one for Bank Accounts, and one for Transactions. On the transaction form, I have a button to execute a script. What that script does is to:

1. delete current record

2. go to related record(in this case, the bank account the record -- the record that has just been deleted -- belonged to)

The script works fine when there is more one transaction in a bank account(I think it's because even the current record has just been deleted, there are still other transaction left for the relation to work). However, when there is only one transaction left, after deleting the current record, there is no more record left to make the relation, and I can't get back to the related bank account anymore.

So, is there anyway(using variable or not, ...) to "remember" what the related record was before, delete the current record, then go to the related record?

Thanks

Posted (edited)

First execute the GTRR to select the correct parent record, go back to the child and then delete it. Finally simply change the layout back to the parent.

Jens

Edited by Guest
Posted

You might try it the other way around:

Go to Related Records [ Show only Related Records ; layout: Child Layout ]

Go to Layout [ Parent Layout ]

Delete Record []

Go to Layout [ Child Layout ]

Or you can capture the parent RecordID, delete the parent, then navigate to the child layout and perform a Find for those child records with that parent RecordID as the foreign key.

  • Newbies
Posted

Thanks for all your help!

I got the script working as follow:

Set Variable [ $parentRecordID; Value:transaction::account_id ]

Delete Record/Request

Go to Layout [ “account” (account) ]

Enter Find Mode []

Set Field [ account::id; $parentRecordID ]

Perform Find []

Posted

You can also set up the relationship so that when a parent record is deleted, the child records are automatically deleted. But, you need to be careful with that option.

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