Jump to content

Allow creation of records


margita
 Share

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

Recommended Posts

Could someone explain the following:

if a join table is created with two relationships to parent tables, should both relationships be allowed to create records in the join table. Or is it just one relationship that should be allowed to create records - if so which one.

Thank you.

Link to comment
Share on other sites

It depends if you want to show the songs of a singer or the singers of a song.

The "allow creation" checkbox only matters if you're going to add records directly though a portal or script it in such a way that the record is created via the relationship (i.e. setting a related field using a common FileMaker technique). Just because you don't set the checkbox doesn't mean you can't create related records, it just means you create them via a script.

It all depends on what you're trying to do.

Link to comment
Share on other sites

Many thanks.

So if both check boxes are ticked on each side of the relationship with the parent tables, would it mean that I would want to show both songs and singers?

It is interesting what you say:

" Just because you don't set the checkbox doesn't mean you can't create related records, it just means you create them via a script."

I don't think I've seen that explained anywhere in any manuals - or have I missed something? Would you be so kind and elaborate a little on the above? Do you mean that related records would be created via an actual script that would be created in ScriptMaker?

Margita

Link to comment
Share on other sites

I meant that you might be on a song layout displaying a portal of singers, or you might be on a singer layout with a portal of songs. So yes, if you're going to do both of those and want to create records via portal, then you'd want both songs and singers to create records in the join table.

It's easy to create a related record with a script. One method:

Set variable[ $id ; parent id ]

Go to layout [ child ]

New record

Set field[ parent id ; $id ]

Go to layout [ original layout ]

Link to comment
Share on other sites

Correct. If you do not check the boxes, you would have to create the record via a script in script maker, and you would also be required to populate the data field key in your join table using the same script.

If you have:

singers <--> join <--> Songs

By checking the box between singers and join you could:

- use a portal in singers to view the data in the join,

- create a record by simply entering data directly into the portal. As a result, the key from the singers would be populated automatically in the join table

Alternately, you could also use a script to automatically create a record in the same manner by using the setfield() script step and just point it to the join table. Since the source is going to be singers - it will automatically generate the key on the new record.

Link to comment
Share on other sites

Thank you both so much. Both your explanations

are very helpful. I did not realise that related records could be created via scripts as you described.

I am just wondering why you used a variable in this particular case?

Link to comment
Share on other sites

I am just wondering why you used a variable in this particular case?

Well, you have to have some way of associating the new child record with the parent record you started from. Back when dinosaurs roamed the earth, we would have copied the parent id, then pasted it into the child's id field. As recently as FileMaker 7 we would have used a global field and Set Field commands to move the id from parent to child. Or perhaps we'd use Import (still a useful technique -- all these thing have their place).

But here we are in the 21st century and we have this wonderful tool in FileMaker 8: variables! We can set a variable in a script, and when the script ends we can forget about it -- unlike a global field that we must take care to clear out; and unlike copy and paste where we blow away the user's clipboard.

Variables are easy to use, easy to maintain, and all-around efficient. A variable in this case was the best tool for the job; and that's why I used it.

Link to comment
Share on other sites

Actually, I forgot to ask this question:

I have both FileMaker Pro 8, The Missing Manual and

Special Edition Using FMPRO 8. Both of them mention variables - but that's just it, there is not enough on them with some good examples.

I was wondering where I could find out more about them? It is not very clear in both books when exactly local and global variables should be used (in scripts and user-sessions etc). At any rate they do not explain the variables so well as you.

Thank you.

Link to comment
Share on other sites

Does no response mean that there is no proper explanation on variables with examples anywhere?

Scriptology by Matt Petrowsky and John Mark Osborne does far more than any FileMaker Pro manuals on the subject of scripts. Now that variables are a new feature in version 8, the manual does not elaborate on them sufficiently enough.

If you think I am wrong, then I would be grateful if you could point me in the right direction - specifically where I could find good examples.

Thank you.

Link to comment
Share on other sites

I begin to wonder why p.448->p.454 in "Using Filemaker8" is considered insufficient?

What you're asking for is very similar to asking to be spoonfed with when to use calc'fields vs and when to do a task with scripts. On the other hand if you ask what to use them for, would the answer again be highly subjective... but if you wish to get inspired would this be a great read:

http://tokerud.typepad.com/filemaker/2005/11/filemaker_8_usi.html

...and here an improvement of the technique:

http://www.fmforums.com/forum/attachment.php?attid/5922/

There is unfortunatly no way around to gain you own knowledge, by using and abusing them untill you wommit ...it's the classical theme "Can virtue be learned"

http://www.mind-revolution.com/forums/showthread.php?p=292

--sd

Link to comment
Share on other sites

Plato did not deal with the subject of virtue just with a few words, let alone a few pages.

The question is how relevant is your Plato example to learning about variables. You can learn about the notion of virtue - in this way you gain knowledge. Can mathematics be taught?

Yes, it can and you gain knowledge by practising the examples - and in addition to this if you are lucky enough to have a good teacher around who you can ask questions.

Yes, I have seen all the URLs you pointed out. It is precisely on the basis of my research why I thought I could try and find out if anything substantial has been written on variables in FileMaker - in depth. Clearly, this has not been done - certainly nothing comparable to Petrowski's and Osborne's Scriptology.

By asking questions, one also gains knowledge - naturally questions do not form all knowledge. They may help to find the truth.

And last, on the question of depth: how deep it is to make assumptions about people asking questions who we never met face to face and who we know nothing about, let alone their circumstances and their qualities.

Link to comment
Share on other sites

if you are lucky enough to have a good teacher around who you can ask questions.

Wrong - it's the kind of teachers, who ask YOU the questions!!!!

you gain knowledge by practising the examples

No it doesn't... it only train or shapen your spindoctoring skills, say if you observations and results doesn't exactly follow what the theory says ...the aim is not to make you think but instead to learn to say the right things to the right people at the right time. You can't learn math ...you recognizes it, by being nursed into it.

--sd

Link to comment
Share on other sites

Hi Margita-

Variables, unlike scripts steps, are not an FM invention but a basic feature of algebra. Your question is a little like asking 'Has anything substantial been written about Filemaker and addition?' The answer is no, there is no need as the concept of addition and variables has already been very well defined in math.

Wikipedia is a good starting point.

-Raz

Link to comment
Share on other sites

Gaining knowledge is complex - based on different, inter-related components, this includes practising as well.

You can ask teachers questions and teachers ask you questions. It works both ways - it is never one way.

Let's agree to disagree.

Link to comment
Share on other sites

Hi Margita,

I think asking about in-depth information on variables is a GOOD question. I KNOW there are many ideas for their use that have not been mentioned on any forum. It shakes down like this ... we can't say what these new uses are/will be, simply because we haven't discovered them yet; variables are too new. Hence, no book and no in-depth answers. Questions are always good; simply always. :wink2:

LaRetta

Link to comment
Share on other sites

I think that this "feeling about certain gaps regarding variables" may be due to the fact that variables just aren't that complicated: a variable is simply a temporary place to store text or numbers. The rest, as they say, is just commentary.

Sometimes it's handy to use a variable just to make scripts or calculations more readable, especially if you're going to use a field in more than one or two places in a script:

Set Variable[ $cost ; biglongtableoccurrence::biglongfieldnamecost ]

Set Variable[ $qty ; biglongtableoccurrence::biglongfieldnamequantity ]

Set Field[ total ; $cost * $qty ]

Along those same lines, I like to set a variable to Get ( ScriptParameter ) at the top of a script that uses a parameter. Or if your parameter is a return-delimited list like this:

222

10

you can set your variables like this:

Set Variable[ $cost ; GetValue( Get(ScriptParameter) ; 1 )

Set Variable[ $qty ; GetValue( Get(ScriptParameter) ; 2 )

Another good use for a variable is when you need to count how many times you go through a loop:

Set Variable[ $count ; 0 )

Loop

. Set Variable[ $count ; $count + 1 )

. // do something

. Exit Loop If[ $count > 10 ]

End Loop

Those are just a couple of examples. As I said, it's not complicated, the calculations you use with variables are exactly the same as the calcs you use with fields.

Variables vs. global fields

Essentially global fields can do anything variables can do, with this exception:

Variables can be used where you can define file paths in scripts (e.g. in Import or Export script steps).

And this exception:

You can initialize multiple variables in a single script step via a Let() function.

Variables are generally more efficient to use than global fields, however global fields have their uses:

- they can be used on layouts

- they can be container fields

- they can be used as match fields for relationships

- they can be referenced from other files (whereas global variables are file-specific; of course you can pass variables to another file via a script)

- they can persist after quitting FileMaker

I'm sure there are others I've forgotten.

Link to comment
Share on other sites

may be due to the fact that variables just aren't that complicated

My thought as well, but we're here to deal with a person to whom ...Knowledge as such is synonymious to what teaching a parot to speak sentences in fluent cockney, in fact is. Only by repeating mantras often enough makes it apparently less gaping....

Next good question might very well be what's fields good for?? I wonder if I dare to say that a variable a field'ish defintion in a script seen as object - just as fields are storage places in records, but where the global variables can be seen by other scripts AS OBJECT?:)??

--sd

Link to comment
Share on other sites

Sometimes even a very intelligent person may need a bit of hand-holding to make a conceptual leap that in hindsight seems obvious. I tend to be one of those that benefits from real world examples before I can really grok a concept.

Link to comment
Share on other sites

Evidently a person of low intelligence like me is incapable of grasping knowledge based on a priori judgements.

It seems that knowledge derived a posteriori is reserved only for you - in other words, you have great advantage over me based on your wealth of experience which you gained over the years.

It is very disappointing that you should sink so low and not recognise the fact that others need some time to experience objects, matters of fact or real existence.

Your statements, particularly the last one (misspelled) are astonishingly offensive - so much so that I shall not be seeking help from this forum any more.

It is a shame because I had very good help from various participants who were, unlike you, understanding and patient.

I repeat: how can you make assumptions about somebody who you never met face to face, who you know nothing about, let alone their circumstances and qualities. I forgot: yes, you can because you know it all a priori. Sorry, but your arrogance knows no bounds.

Link to comment
Share on other sites

Many thanks, Fitch, for both your posts. Your explanation on variables is very much appreciated. This will help me enormously to grok the concept. I very much needed some examples. If I may say so, it seems that your heart is in the right place.

All my best wishes.

Link to comment
Share on other sites

margita,

Part of the problem here is translation. I've known Soren for quite some time and, although some of his phrases can appear offensive, he isn't directing it towards you specifically but rather towards a general philosophy. There are many wonderful people on this forum. And I assure you that Soren will grow on you ... he's like the family uncle that can rile you one moment and you want to hug him the next. He can appear insensitive but he's a teddy bear and if you can decipher his meaning, you can also learn a great deal!

If you wish to learn ... and I'm convinced you do or you wouldn't be asking perceptive questions then don't let ANYONE stop you. You have a sharp mind and a great spirit. Stick around, kiddo. I like the way you think. In short order, you can teach them a thing or two ... and I am NOT joking. :smile2:

LaRetta

Link to comment
Share on other sites

I have to say this as well ... variables may be simple tools but they can be very powerful when applied in various circumstances. Do you really think you know it all? Using script parameters with variables is only the tip of the tip of the iceburg of possibility. We will discover tricks to increase power and flexibility throughout our solutions and you can pooh-pooh all you like; the fact remains that variables will set us free in ways we've only begun to imagine.

Margita is looking beyond and asking what cool discoveries and unique uses have been found! You are being fussy old women and not at all like the explorers I know you to be. :wink2:

LaRetta

Link to comment
Share on other sites

how can you make assumptions about somebody who you never met face to face

When it's not obvious where the real problem is, must at least some assumtions be tried out to establish facts by exclusion - if you refrain from an introduction to you mission, can't we do anything but guess, why you feel the documentation lacks something to be desired.

What started this thread was a statement similar to "Pigs looks awesome when tanned" ...well, well, well would the reader of the statement say to him/her self ...isn't it obvious that we need to know the reason for this outburst, what is the writer trying to accomplish.

I can't avoid thinking up more than a few assumptions ...but in order not get too carried away, do I feel an urge to get some coordinates by asking for them, sometimes boldly by a strawmans argument, if I feel I'm getting nowhere.

I still can't get into my head why they presents a problem??

It's a feature you not are obliged to use, if you don't feel comfortable with them yet, and often is so with new features that what you should learn by USING them ...actually is to restrain yourself or hessitate from using them all over the place!

In short, remember, just because you can do something, it doesn't mean you have to do it. Grap the features that inspires you most ...Even if they're badly chosen, so what? - You've learned something!

--sd

Link to comment
Share on other sites

Do you really think you know it all?

I havn't said that, my problem lies instead in that the math behind variables well most of the realtional theory is based on deductive proofs ...which is somewhat far from ex cathedra.

Teaching students to make mathematical conjectures requires a spirit of exploration and experimentation in the classroom. Students will be asked to make statements that they believe are true about a geometrical situation. Their suppositions can be made via inductive reasoning, that is, looking at special cases, observing patterns in the special cases and then generalizing from the pattern to make a conjecture. Once the conjecture is stated the students then have a problem to solve. The conjecture needs to be proved by deductive logic or disproved by counterexample. Developing the student’s ability to reason correctly, experiment with new ideas, and to solve problems is our fundamental goal. Essentially we want the students to learn how to reason logically as a foundation for more advanced math classes and to improve their ability to think critically about the whole array of life experiences.

...snipped roughly from: http://www.unm.edu/~abqteach/math_cus/01-03-03.htm

...in this array exists variables, scriptparameters, recursive scripting ...well everything filemaker. It's not a question of an well established tutor can issue a list of sanctioned use!!!!

Fenton Jones expressed very neatly yesterday, the attitude you could approach the new tools or features with:

they should be looking at it as a chance to get things done better, more efficiently, as well as to expand in ways you couldn't easily before.

--sd

Link to comment
Share on other sites

Ummm, going back to the bit where globals are better than variables, i've found the main use that still keeps globals alive is custom dialog input and layout entry's - other than that, for data collection during script loops etc, where there is no real input required by the user (I am thinking this is the defining point here) variables are more useful simply because a) they're quicker :) you can name them appropriately c) if they're script variables you don't have to clear them d) you don't have to create specific fields for specific tasks... My point of view anyway

Basically.. Global Fields you can create on the fly for doing those annoying loop jobs or any type of data collection, sigh i've lost myself - point is, umm, if they didn't exist i'd have a couple of 100 global fields? or a few that i couldn't really identify

~Genx

Link to comment
Share on other sites

LaRetta,

Thanks for giving me some insight into this unfortunate thread.

I take your point on translation. However, English is not my mother tongue either - in view of my hearing which is almost non-existent I fail to see why some people cannot be more careful in the use of language even if it is not their own.

Yes, there are many wonderful people in this forum and I'll go on following it.

Link to comment
Share on other sites

Instead of overcomplicating things and trying to find out what I was trying to accomplish or look for coordinates, it would have been better to look at the beginning and see that I all I was asking for was some good examples.

I did not ask what variables are good for. Yet this gave you enough cause to elaborate on parrots and suchlike. As if that was not enough - I suddenly became a person who was likely to ask next what a field is good for.

If that is not insulting, I don't know what is.

On the subject of your next post:

Teaching students to make mathematical conjectures requires a spirit of exploration and experimentation in the classroom. Students will be asked to make statements that they believe are true about a geometrical situation. Their suppositions can be made via inductive reasoning, that is, looking at special cases, observing patterns in the special cases and then generalizing from the pattern to make a conjecture. Once the conjecture is stated the students then have a problem to solve. The conjecture needs to be proved by deductive logic or disproved by counterexample. Developing the student’s ability to reason correctly, experiment with new ideas, and to solve problems is our fundamental goal. Essentially we want the students to learn how to reason logically as a foundation for more advanced math classes and to improve their ability to think critically about the whole array of life experiences.

This is nothing new - this should be a matter of course in any subject, not just mathematics - the same method is used in subjects such as literature. As I said before, good teachers are there to explain first, give examples, ask questions and students are there to practise, experiment and ask questions as well. In any case, I have nothing else to add to this sorry thread.

Link to comment
Share on other sites

Interesting article, Soren!

It's not a question of an well established tutor can issue a list of sanctioned use!!

Then we are in total agreement and telling Margita this might have helped. Asking the question about variables was not only appropriate, but indicates an ability to look ahead and a desire to know - both qualities I admire. Thanks for clarifying. :smile2:

UPDATE: Welcome back, Margita!! :)^)

LaRetta

Edited by Guest
Added update
Link to comment
Share on other sites

Asking the question about variables was not only appropriate

It was very appropriate indeed, but there were some noise on the line ...JMO and Petrowski were assumed similar. If we look at the intersection here, is it that they both are EDUCATORS and what I indeed missed with this association was that Petrowski to some degree as sidedish'ish have attached some templates to his videos, while JMO certainly provides templates as a second line of business.

Secondly is forums as these not suited for vaugely expressed mission statements - it's simply to far fetched expect overly generalized questions makes sufficient bate, it's not exactly inappropriate but it's insufficient!

--sd

Link to comment
Share on other sites

I agree that "insufficient" questions can be annoying, but if it's about FileMaker, then it certainly cannot be said to be inappropriate for these forums, whereas disrespecting the person asking it certainly is inappropriate. If you don't like the way a question is asked, then either request clarification (and be clear about what you find unclear) or simply ignore it and move on to another post.

Link to comment
Share on other sites

This topic is 5635 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
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.