Jump to content

Question about templates

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

Recommended Posts

Hi all

I'm trying to understand the way some templates of FMP 7 work, e.g. "Resource Scheduling.fp7" or "Task Management.fp7". In these files, I see in almost every table, a field named "one", calculated, value = 1 and also relations based on that field. I understand that it always, in every row of every table that contains it, it equal to 1. Can anybody explain what is this field? Why and how it is used and what we can wait from a relation between two tables based on a field like that?

Thanks for your time


Link to comment
Share on other sites

I use Constant=1 all the time IN 6. It's most often used to do such things as pass values between a field in a file and a global field in another via a "Constant1" relationship (though any relationship can be used to do this). This could be:

Set Field ["local field", "Constant1::global field"] or

(targetting other file)

Set Field ["Constant1::global field", "local field"], or

Set Field ["local global field", "Constant1::global field"]

Its other use is to reference all values (all records) via a relationship, such as to show all records from another file in a portal. It would have to be file with only a few records for this to make much sense.

The reason I say "IN 6" is because you don't need a Constant relationship to pass a value to or from a global in 7. You can use a simple Table Occurrence (TO) of the other table or file (the latter requiring a File Reference). You can use just the TO much like a Constant1 relationship, for referencing a global (since a global value is shared by All records in its table, or TO).

I'm thinking that they have not truly optimized them for 7. I've seen that in their other free templates.

The Constant1 doesn't hurt anything. It's not not always necessary anymore. Of course, before deleting it you'd have to go through all its occurrences and convert them; which is why they didn't.

OK. I looked at the Task Management file. There are 2 "One" TO's, down next to the Assignments table, Contacts One and Tasks One. I do not see them used on Layouts. I see them used in the Create New Assignment script (bottom one).

In both cases it's unnecessary.

Set Field [ Assigments::Contact ID,Contacts One::Global Contact ID ]

could just as easily be,

Set Field [ Assigments::Contact ID,Contacts::Global Contact ID ]

You can use the plain Contacts TO; the Contacts One TO and its relationship is superfluous (I didn't see any other occurrence of it; but I may have missed it). Perhaps it's easier for beginners to see the relationship. But I don't think that's the reason it's there. I'm afraid it's because FileMaker didn't take the time to optimize their templates.

There's no harm done. Both ways work. But the Relationship graph is cluttered enough without these vestigial Constant relationships, IMHO.

Link to comment
Share on other sites

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