Sign in to follow this  
Followers 0
davehoran

Invalid relationship when deleting records in converted databases

2 posts in this topic

I am working with a FileMaker application that was built and maintained in FMP4, and am trying to migrate into FMP11.  The files were converted first to .fp5, then imported into FMP11 and coverted to .fp7.  Overall the fields, layouts, scripts and security accounts survived the process with only some adjustments.

 

However, there is a problem with deleting records through a portal.  Our main DB layout contains a portal to another table in another .fp7 file.  The Relationships chart shows the relationship, and has the "Allow creation of records in this table via this relationship" and "Delete related records in this table when a record is deleted in the other table" checkboxes set for the portal source table.  New records can be added through the portal with no problem, but when trying to delete I get "This operation cannot be performed because one or more of the relationships between these tables are invalid."

 

Some particulars: The delete button is a container field from another table/file (not the portal source file).  The Relationship is keyed on an ID field, but that field is not shown in the portal; the Delete Portal Row script is preceded by a Go to Field[select/Perform] that references a name value field on the portal row.  The portal source table has Relationships that also set the "Allow creation of records in this table via this relationship" and "Delete related records in this table when a record is deleted in the other table" checkboxes - so deleting the portal row should also delete rows in that relationship (cascade).  Deletion doesn't even work when clicking the "Delete Record" button directly on the DB file. (I've seen on numerous occasions that this particular dialog is unhelpful and I agree - its no more helpful than the Check Engine light in your car).

 

I will also note that this delete functionality DID work in the conversion from .fp3 to .fp5: I can open these .fp5 files in FMP5 and the app works fine.

 

Any thoughts?

Share this post


Link to post
Share on other sites

Update:  I did find the culprit that was breaking the delete script.  There is a self-join that uses a key value of the table combined with the key value of another table.  I believe that when deleting this calculated field does not resolve and breaks the relationship.  I removed the relationship and the process worked fine.

 

I AM curious as to why this relationship worked in FM5: The delete process does complete with the relationship in place.  What changed in how self-joins work in FM11 versus FM5?

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0

  • Similar Content

    • By fireandlight
      I've driven myself more or less crazy trying to figure this out on my own. The relationships themselves are rather simple: Each project has a list of questions. Each question has a person who created the question, and someone the question is assigned to. A question also has a number of responses associated with it which each have their own "creator".
      There are 3 main tables to cover: Questions, People, and Responses
      People consists of 3 fields: The UID, the person's name, and the person's email address Questions has 2 fields which relate to People: creatorID and assigneeID Responses has 1 field which relates to People: creatorID. The way the relationship graph is set up now, I have 3 instances of the People table that relate the UID field to the appropriate ID field in Questions or Responses as needed.
      What I want to happen is when I set an Assignee or Creator for a question or response, I want to use the corresponding record details from the People table - if one does not exist, then create a new one. Instead what happens is a get a new record in the people table every time. Even if I set the Layout field to give me a drop down of the existing values (and I use it to select one when, say, setting the assignee on a question) it still creates a new record. So confused... any help is much appreciated.
    • By Laura Griffin Long
      I would like to see if anyone could help me to verify if the problem I am having is a bug in Filemaker.  I have recently upgraded my network from Filemaker 13 to 14.  In 13 I did not experience this issue.  It seems that in Filemaker 14, when a particular Hindi character is pasted into a Filemaker field it crashes the database.  I have tested this on numerous machines within my network with the same result.  I am hoping that someone will run this simple test for me and report back if it happened to them as well.  I just need someone to create a database, create one text field.  Create a new record and paste this Hindi character in that field.  Then do a find and place your cursor in that field. At this point the database should crash.  If anyone can confirm this I would love to know, thanks! 
      Hindi character: क्स्ड (I will also attach a text file with the Hindi character in case something messes up when I post this...)
      hinid_error.txt
    • By JoP
      I have a solution with 4 Databases. There is the main-data-database on a Filemaker Server (only data, no relationships in the Table-Occurences (TOs)) and a GUI Database on the Desktop (only Layouts, TO's are included from the Server-Database and on this TO's the relationships are defined, so I can use them in the Layouts. Than I have a 3rd database, which is a subset of the server database and lies on an iPad. This 2 data-databases will be synchronised by MirrorSync. And the 4th Database is a special GUI Database on the iPad which uses the 3rd database for Data. The iPad GUI Database also holds TO's with relationships.
      Now, I need a custom privilege set to forbid changes and deletions of records when they are marked as Locked. To see all tables in the privilege dialogs, I can only do this in my data-databases, because in the GUI databases I can't see the tables in the dialogs. But in the data-databases I have no relationships defined, so I can't use related tables in the formulas. Now I have to add these relationships also to the data-databases. Is there a simple way to "copy" them from one database to an other?
      Thanks, Hans
    • By Ultradistance2005
      I have a database with each record representing one account. Within each account record, there are ten different companies the account may have been sent to (one individual field for each company within the same table), along with the results of that effort. Both of these make up the company data set. Also within that single record there is an identifying ID Code, which represents the type of account it is.
       
      What I want to do now is create a table with a portal where I can select or enter an ID Code, and get each instance of that ID Code with each individual company data set. So if with the individual account record I noted that I sent it to four of the ten companies, I want it to return four responses, one for each of the companies I sent it to, with the unique responses (also in a field in the main account database) with the details of the individual record.
       
      I feel like the answer is right there, but I just can't get it to work. Any suggestions would be much appreciated. Thank you.
    • By Gianluca D'Aquino
      Hello there,
      I'm just investigating on 2 issue I have on sync 2 DB, 1 on the server and 1 on the iPad that are set to use a Spoke Db in the middle tier.
      Basically the sync is set to copy ALL the data from some tables on the server to the local db and send some data from the local db to the end server db. For some reason, on a large table, called Articles, with more than 130k records, the sync does not copy all the record for some users. There is no 'filter' based on user on the end db, and I run a pre-populate sync on the spoke db that copied all 130k records. When the sync is run for that specific user, the final result on the iPad is that the sync DELETES 12k records for no apparent reason.
       
      In addition, there is a Global table that has always 1 records and is get from the server to the client. But I found some times that there are several records on that table (more than 10) on the server, even if the sync is set to write on the spoke and not viceversa for that table. I have the suspect that are written from the sync. Is it possible?
      Thanks in advance,
      Gianluca