September 2, 200817 yr Hi, I'm creating my first separation model solution with two files, myDB and myDBData. My question: do I create the relationships in the base data myDBData file as well as the interface/business logic file myDB? At first glance it would seem redundant to do so, but I'm creating several many-to-many relationships in this solution so I wonder if I shouldn't have the relationships in the data file too. TIA for any help, Pat
September 2, 200817 yr Relationships in the data file may be needed when a related field is needed in a field definition's calculation, or auto-enter by calculation, or for a Lookup. But not so much for portals, filters, navigation, etc., because those are more about presentation of the data rather than the data itself. Presentation requires a layout with an attachment to a table occurrence of the interface file anyway. The general rule I think would be: Don't create a relationship in the data file unless you have to. You will generally know that when defining fields.
September 3, 200817 yr Author Thanks Fenton - that's really clear. I'll follow your general rule, remove all the relationships in the data file and put them back only when I come across a requirement.
September 9, 200817 yr some other caveats... Custom functions if used may need replication in both files. Variables don't work across files. - I had fields using $variables to auto enter data on a field when the record is created but they didn't work when the script is initiated in the interface file. I had to resort to globals and pass the values thru a relationship. Using "SELF" function in a calculation didn't work when evaluated thru the relationship in the data entry screen of the interface file. - I had to use the actual field instead of Self.
September 9, 200817 yr Author Interesting points Stephen. I suppose if you're moving to SO then the idea is to be more purist (read SQL-esque) and avoid some of the useful stuff in FMP. Not my intention!
Create an account or sign in to comment