Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Allow creation of records via relationship?


Recommended Posts

When creating a relationship between two tables, there is a checkbox that says "Allow creation of records in this table via this relationship". Can anyone explain to me how this works?

Link to comment
Share on other sites

If you check that option it means you can create records in table 2 from a presentation which displays records from table 1 using a relationship.


Let's suppose you have a relational database with two tables, which store CD names and CD songs. Each CD has many songs. The relationship between both tables is done using a field named, for example, CD_ID (a number, if you want). You have a presentation displaying the CD info (author, name, year, etc.), and a portal using the relationship to display the CD songs from the other table. If you don't check that option, you MUST create the songs through a presentation using the data from CD songs, but you can't create the songs using the portal.


Not checking that option is probably the most common error source when you create a portal and you try, unsuccesfully, to create a new record in the portal.


Best regards,

Link to comment
Share on other sites

In my case, I have a product page. On that page is a drop-down list containing values from a value list. The value list is generated from the 'name' field in the manufacturers table.


If in the product data entry, I enter a new manufacturer name, then this name doesn't appear as a new record in the manufacturer table. What am I doing wrong?

Link to comment
Share on other sites

You have a field "Name" in Products. It has a value list which is drawn from the "Name" field in Manufacturers. You manually type in a new/different value in Name in Products. That name hasn't been added to the Manufacturers table, only to the Products table. The value list draws from Manufacturers, remember?


Could you use the "allow creation of records via relationship" feature to auto-populate the Manufacturers table with a new entry, thereby adding that new name to the value list? Yes (but not without tradeoffs):


There needs to be some field over in Manufacturers, aside from Name. Let's say it's Creation Date. You create this simple script:


Set Field [Manufacturers::Creation Date, Get(CurrentDate)]


...and attach it to an "Add" button next to the Name field in Products. Then if the manufacturer's name isn't in the value list, you type it in manually, click the "Add" button, and it has been added to the Manufacturer's table (and thereby to the value list)


The tradeoff: I assume the Manufacturer's table probably contains a lot of fields. Address, Telephone, web site, FAX, stock ticker code, category, etc etc.... auto-adding values in the above-described fashion means you end up with new records that only have names. So you have to come along behind and find them and add the missing info.


You might prefer that, instead of adding names on-the-fly like that, you have your "Add" button navigate to the Manufacturer's data entry screen; you create a new record there, put in all the data, then click a button that says "Return to Products", go back to your name field, select the name (which is now in the value list), and continue about your business.

Link to comment
Share on other sites

Uh, that's a different problem. The most easy option is not to use those manufacturers name from other table as value list, but define a value list with those names. This is the dumb solution.


If you want to create a table with manufacturers to use it as a value list and/or other purposes, then you will have to add new entries to that table (i.e., new manufacturers) going to a presentation which browses the manufacturers. You can make that with a button going to the other presentation. In fact, both tables don't need to be related at all.


I suppose a good example is the photo album database that Filemaker includes as example. For the main table it uses a keyword list taking the values from a keywords table. But if you want to add new keywords, you must go to the presentation managing the keywords table.


Does this helps?

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

Terms of Use