ISO FileMaker Magazine: FileMaker Video Tutorials, Templates, Help & More

FileMaker Deals

Video Browser

Scriptology Video Browser

Tools & Resources

Scripting And Commit

Delete Record/Request removing data from related records

Posted by: MaxR / Wednesday, May 16, 2007 – 6:03pm

I had a looping script which took imported data and created new records of different types via relationships in an imported data table. Initially, I scripted this "takeon" loop on the basis of Next Record/Request, exit at end. All tested out OK. Then instead of the Next, I put in a Delete Record/Request with an if to exit when no records remained so that at the end of the process, all Imported data in the Takeon table would be removed. The loop worked fine. The functions also worked fine. But then I discovered the Delete Record/Request would not only delete the imported data record, it performed what seems to be a Revert Record function removing data from record(s) recently created and updated
with SetField statements. The related records however remained - just the data was removed.

The cause of this was that in some situations the script would change layouts. Changing layouts forced a commit. But in other instances, a commit wasn't getting executed. No commit, no data retained. Simple.

------

Max Rogalsky
Melbourne, Australia
www.maxiwyse.com.au

Syndicate content