MacDigger Posted May 27, 2001 Posted May 27, 2001 Hi, I'm trying to implement an unlimited depth directory-tree structure in FM, and faced a pretty annoying problem: Directory structure is defined as: id - number parent_id - number dir_name - text there is also a relationship which links current directory with its parent directory: parent_id->id and a calculation field targeted to recursively construct full path: fullPath = id_to_parent_id_rel::fullPath & "/" & dir_name As a result I expect to get full path to a directory tree's "leaf", in the form of: "/Level1/Level2/Level3/..." logically, there shouldn't be any loops (of course, if dir structure is intact), but FileMaker tells me that this is a circular definition. Anyone have any idea how to solve this problem? Or probably this is a limitation of FileMaker which can not be got around? Any suggestions are welcome! TIA, Mike
Chuck Posted May 27, 2001 Posted May 27, 2001 It's circular because you're probably using a field in a calculation that references itself in the relationship. For instance, you probably have a field called "Folder_Name" that is set up to see the value of it's parent folder, which is the same field through the relationship. I was trying something similar to this recently, and the workaround I used was to not use a relationship, but to use leading letters and numbers for the folder names. This worked for me because the solution was to create the folders using AppleScript. So my top level was 1. Top Level Folder and below that I had 1a. Sub Folder One, 1b. Sub Folder Two, etc. Another possible workaround might be to use lookups instead of related fields. Let me know how it works. Chuck
Recommended Posts
This topic is 8585 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