PatriciaW Posted March 23, 2005 Posted March 23, 2005 Possibly a really dumb question: How do I add a record to a file when I am using different files for the UI and data files? I don't seem to be able to do the insert from the UI because the New Record/Request does not allow me to specify the file name. Is there another script instruction that permits me to do this?
aaa Posted March 23, 2005 Posted March 23, 2005 There are few ways to do it: 1. Call External script which adds record to file 2. Using relation to this file If you try you will find how to do it.
PatriciaW Posted March 23, 2005 Author Posted March 23, 2005 I eventually figured out the piece of the jigsaw that I was missing. It was the concept of Current Table. I haven't seen it documented and didn't realize its effect. So I created a dummy layout on the table I wanted to add records to and then used a Go to layout step before I did the New Record/Request. That appears to work. I already had a relation and the script in question was an external script already. None of those helped. The current table concept was the issue. It is not specified (any where that I could find) that when you look at a Go to layout statement in a script that the field in parentheses following the step is the name of the current table. This may be obvious to people who have used FileMaker for years, but I am just learning using a demo version and no manuals.
bruceR Posted March 24, 2005 Posted March 24, 2005 The concept is called context and it is explained frequently in all the documentation about FM7. Why call it a dummy layout? If you are going to operate on an table, e.g. new record, you need to be on a layout based on that table. This can be done in the interface file with no problem at all.
PatriciaW Posted March 24, 2005 Author Posted March 24, 2005 The reason that I called it a dummy layout is because this is an existing application and although I need to operate on the table, it is not the primary data source on the layout. (The layout is a tabbed layout and has the main information in the top of the layout, and the secondary information in the tabbed area.) And as for the reference to context, that is rather vague and does not reference the term "current table", in particular with respect to adding new records in scripts which is what I was talking about. The New Record/Request step does not mention this. If FM7 is going to support multiple tables in a file and a separation model, I think this is something that needs to be documented. I should add that the reason for most of this restructing was because I could not use Go to Related Record once I decided to implement the separation model, so I had to copy some layouts and scripts into the User Interface layer.
bruceR Posted March 25, 2005 Posted March 25, 2005 "I should add that the reason for most of this restructing was because I could not use Go to Related Record once I decided to implement the separation model" Not true. What makes you believe this?
PatriciaW Posted March 26, 2005 Author Posted March 26, 2005 I believe that because when I used GTRR it took me to the data file that contained the table, not to the interface file that contained the layouts ... I had to copy the layouts into the current interface file. There was no way of specifying which interface file I wanted to use to access the table.
T-Square Posted April 5, 2005 Posted April 5, 2005 Your last post suggests a misconception or two. 1) You mention having to copy layouts into the interface file--which is precisely what you have to do with the separation. The separation is between the interface (i.e., the layouts, and some say the calculations), and the data (as represented by the tables that hold the actual data). The bugaboo with changing over to a separation model is that you have to copy your layouts into a separate interface table without having Filemaker break the layouts in the process. Part of the process is that you need to recreate the relationship structure in the interface file. When I originally ported a multi-file solution to 7, I had something like 80 "tables" in the Relationship window. There is a great deal in the forums about porting to the separation model. 2) You use the phrase "specifying the interface file"--but really, there should only be ONE interface file (and therefore specification is unnecessary). The GTRR problem goes away if you build the UI file with appropriate relationships. In other words, if you have a GTRR in the interface file, there should be a Table Occurence (TO) in the UI file for that TO. Of course, you will also have to have a layout built on that TO. To clarify: Your interface file needs the following: a file reference to the data file, at least one table occurence for each data table in the data file (you may have more), and layouts built on the table occurences. HTH. David
PatriciaW Posted April 6, 2005 Author Posted April 6, 2005 I'm sure I have many misconceptions ... The problem in this case, was that the Table that I wanted to create a new record for was only being referenced in a portal window. Thus there were no layouts defined on the TO. The script used GTRR to add a new record to the Table ... but once I split the UI from the data, the layout that had been used was in the UI and there was no way of linking to it, when I specified the base table. No doubt, there are different ways of doing this in FM7, and I just found out that it is possible to specify Portal Rows ... and maybe this would have helped. But in the meantime, I did move many of the layouts into the new UI and things are working. Maybe not as elegantly as I would like ... Thanks for the feedback.
Recommended Posts
This topic is 7240 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