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

Navigation

Video Browser

Scriptology Video Browser

Tools & Resources

Unlimited Infinite Hierarchies

Posted by: Editor / Thursday, April 23, 2009 – 5:00pm

by Matt Petrowsky

79
 minutes

You've always been able to implement Hierarchies within FileMaker Pro - even back in version 3 - at least from a data standpoint. You can easily use two fields to manage a Parent to Child relationship. However, the biggest problem of understanding, implementing and using hierarchies rears its ugly head when it comes to managing and allowing users to interact with them.

Along comes FileMaker 10 (which the referenced file requires) and you're now able to more easily manage an unlimited number of hierarchies based on any tables or records in your solution and each hierarchy can have an infinite number of rows. There are no limitations based on table occurrences when you understand the data structure of how it all works.

The remaining problems to solve are related to user interaction with the Hierarchy and maintaining state of collapsed and expanded rows.

If you've always wanted a deep understanding of how to use these "folder trees" (know as posets in Hierarchy mathematics), you'll be hard pressed to find better information about getting them into FileMaker Pro!

Details: Released - 4/23/2009 / Size - 29.21 MB / Length - 79 min
About author

Matt Petrowsky is the Senior Editor for ISO FileMaker Magazine. Matt has been involved with FileMaker Pro since the early '90s. Having authored many articles, a popular book, spoken at conferences and seminars, as well as provided private training, Matt is continuously updating his knowledge and skill about the powerful FileMaker platform. You can contact Matt by sending email to editor@filemakermagazine.com.

Filed under: |
-
.

How does this compare to an alternate method?

.
.
.

Matt, I've been wanting to do unlimited hierarchies for a while, and was tearing out my hair over various roadblocks. So I'm really glad to to know about the method you show in these videos.

I've been working for a while on a different method, and I wonder what you think about how the two compare. I've been working on storing the hierarchy for each list in a text field as nested xml data. In other words, the data would look something like this:


<record id="1" expanded="1">
<record id="2" expanded="0">
<record id="3"></record>
</record>
<record id="4"></record>
</record>

A custom function spits out a list of id numbers to a calculation field, that are then displayed in a portal. Of course, this can't display the same record more than once in the portal.

Unfortunately, this has involved laboriously writing many custom functions to parse the xml, calculate ancestry, level, etc. Neither is it as native an approach to Filemaker as yours is. However, it makes issues like moving and sequencing records less of a problem. I don't know yet how the performance will be, but by my preliminary tests, it might not be great.

Anyway, do you see other advantages / disadvantages to the two methods?

Thanks,
Nathan

.
.

Not working properly.

.
.
.

Matt,

This technique is really great. A little too hard to implement, specially for newcomers in FM like me. Anyway, I think we may have a situation you haven't consider (or perhaps I didn't understand it). Please, correct me If I'm wrong. Here it comes:

In your script "Repair Sequence", sub-item: "Sort initial sequence by branch level and adjust leaves which are not in order",
on the third script step: "Replace field contents", specify target field, you have the following calculated value:

If (
Me::Sequence - Parent::Sequence > 1 // How far away am I from my parent
and Me::Level > 1 // As long as I'm not at level 1
and Count ( Parent Children::Sequence ) = 1; // And I don't have any siblings
Parent::Sequence + ,0001;
Me::Sequence
)

Ok. But I do have siblings. Lots of them, actually. I'm working on some kind of BOM (Bill of Materials). As a matter of fact, I took the liberty to modify your technique raw data file, in MyGroup (RecordID=1), and changed the Parent ID of "Amanda" (ID 18). Instead of having "Louise" (ID 12) as her "Parent", I changed to "Ana" (ID 11), her "new Parent". By doing so, now "Ana" (ID 11) has two children, "Amanda" (ID 18) and "Mary" (ID 3), therefore, we now have "siblings".

Happens that when you click on "Ana", on the Groups Layout, her two children "Amanda" and "Mary" appear below "SAMANTHA" (ID 22)!!!

I don't think this is what you intended to do. May be we need another "elseif" that states this condition ( I HAVE SIBLINGS ), and in this case, I really don't have any clue how to accomplish it.

So, please, tell me what I'm doing wrong, so I can have these "Children" below its "Parents".

Thank you very much for your time, and "happy filemaking".

Alvaro Guedes
Civil Engineer
São Paulo - Brasil

.
.

Why i can't download

.
.
.

Why i can't download technique file??

.
.

Add / Delete

.
.
.

As mention on your videos, did you complete the template with ability to add and delete from the hierarchies.

.