Jump to content
Sign in to follow this  
davehoran

Invalid relationship when deleting records in converted databases

Recommended Posts

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  

  • Similar Content

    • By Lowermountain
      Hello,
      New to Filemaker and new to this forum. Hoping someone can help me out.
      I am working on a personnel planning system with, among others, the tables Employees, Shifts and Availability. 
      tblEmployees has fields like Employee ID
      tblShifts has the fields Employee ID, Start Timestamp, End Timestamp
      tblAvailability has the fields Employee ID, Start Timestamp, End Timestamp and Status
      When in the layout Shifts I want to open a portal in a popup and I want this portal to be sorted by Availability and I want the portal rows with employees to be 'greyed out' when status = 0, green when status = 1 and normal when no Availability is given.
      I basically need to know which records from tblAvailability match records from tblShifts and then which records from tblEmployees match records from tblAvailability.
      How do I go about this? Do I need SQL?
      Hope this is a somewhat clear question. Many thanks!
    • By HJS
      L&G,
      I have read the guidelines for posts in this forum. Therefore I did not enter the Post title that came first in mind: Do I understand portals (aka do I understand Filemaker) and I do not emphasize now on being new in Filemaker issues.
      I am trying to achieve something simple at a first step of a big plan: Entering recipes in a Filemaker testversion database. 
      The longterm goal should be a database in which I can enter my collected recipes.
      Followed by tool for a weekly menu plan for my family and a shopping list coming out of the database after taking care of my fridge's stock => so far so good, but currently this is a plan for the next ten years I realized starting with Filemaker.
      I searched different apps and database programs, and Filemaker seems to be my solution as I did not find anything that fits exactly my expectations.
      So back to the first problem: how to enter my recipes?
      I created a table of recipes with an unique ID_pk (I learned already about pk and fk), Name and How-To-Make-it as well as IDs(fk) from the other tables which are Zutaten (Ingredients) with the name and the amount, Form_Zutaten (how the ingredients are used i.e. chopped, sliced, etc.) and Einheit_Zutaten (unit i.e. cup, liter, etc.). Why I have choosen this structure: because all ingredients must be combinable with different units and how the are used. otherwise I have to enter e.g. avocado sliced, avocado mashed, etc. or make rules like liquids can only be liter or mililiter or cups while flour can only be gramms etc.
      So a combination of all three tables should be possible.
      What I though might be an easy task is to create a recipe layout than with 
      recipe ID
      recipe name
      and a dynamic portal depending on the number of ingredients constisting of:
      Zutat - Form - Menge - Einheit
      in english: Name of the ingredient - how is it, which kind/form - how much (qty) - which unit
      so I related the tables via pk and fk, created the layout and bam: complete disaster.
      after needing a couple of days to make the values appearing in the dropdown (learned about the value list), some fields in the portal do show the all entries of the ingredients, while the kind/form and unit fields do always show the first value of the table?
      and although I locked the fields, the first entry is always shown and is getting overwritten by the choice I choose from the dropdown...
      and nothing is dynamic, meaning that 7 ingredients will make 7 lines and it always starts with one empty line, etc.
      I am not sure if my descriptions do make sense, therefore I am attaching my work, hoping someone could help me with how to use the portal for a convenient data entry.
       
      thx in advance!
      br
      HJS
       
       
      2017_09_Essensplan.fmp12
    • By 123
      Hey,
      I have the following problem. I'm working on a solution for the owner of several restaurants. Each restaurant has meetings once or twice a month. How would I structure the tables so that I could have a layout on which I select a restaurant and then inside a portal I get a list of all employees. On the portal for each row I want to have a button or checkbox to mark if an employee is present or not.
      I already have the following tables:
      Restaurants, Employees and Meetings
      So far I have a relationship between the Restaurants and Employees table which I use to assign employees to a restaurant, and a relationship between the Meeting and Restaurant table, which allows me to show all employees that work at a selected restaurant using a portal on the meetings layout. How do I proceed to solve my problem? Do I create another table MeetingAttendees or something similar that I use to keep track of people attending a meeting? How would I create a relationship then to allow me to mark certain employees as present and absent?
      Thanks in advance,
      Mike
    • By Stickybeak
      When I try to start FMP16 - since the latest update - I get an error message without any part of FMP appearing on the screen. There is a lot of data but the bit that caught my eye is this:
      Anybody else having or had this issue?
      Any known solution?
      Filemaker support seem to think its an Apple problem - something to do with my user account.
      Apple seem to think its a filemaker problem.
      Happy to supply the rest of the error message if required.
    • By jeffwest2
      Had to step away from this for a while, but now back with it.
      I have nailed up the two tables I want to sync, however, when try and sync, I get an error that reads
      Attempt to push data has failed (The message received from the server was : "201")
      I have two questions really.
      I don't need to push data, as no data will be allowed to be changed on the 'mobile' side, can I disable this, if this is what the issue is.
      What is a 201 error, and how can I identify which field is causing the issue?
×

Important Information

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