Sign in to follow this  
Followers 0

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

    • Need through relationship
      By pctechtv
      While creating a database that has Products, Suppliers and Lines I have come across the need to calculate a count of the suppliers from the context of a Products record. My relationship is like so:

      My question if I want to pull a lot of information about Supplier is should my portal in the Products record be from Suppliers or from Lines? If the best answer is Lines, could I still have a count of related Suppliers by using the primary key from that table in the portal? Is it a bad idea to use fields from a related tables portal other than its own? Thanks
    • Help for simple yet frustrating problem for creating a note section
      By jazzygb1
      I have a Filemaker Pro 11.04 database running and it's great.
      However I wanted to make a simple amendment which is proving very frustrating to do.
      I have a customer contacts layout that I can click on a button to create invoices. All the relevant contact data is ported and I get taken to a new layout (Invoice Data) where I input the relevant information for invoices (the items, quantities etc).
      When I'm ready to print I click another button on this layout and  it takes me to another invoice layout (Invoice Print) that condenses the information input into the data layout into a more printer friendly version and prints it off (via script) automatically  -  this has worked like a charm for years!
      Recently though our invoicing layout requirements have changed and I wish to add a note box that I could type short messages that would be specific to that invoice (i.e not something that will appear on every invoice) - just a simple text note should be perfect for this.
      So I created a new field called 'Invoice notes' and set it as a text only box and added this field to both the 'invoice data' layout and the 'invoice print' layout.
      I thought that would be it, but when I'm in Browse mode and add text into this box, whatever text is added is erroneously added to every invoice - not what I wanted at all.
      All I want is to be able to leave a small individual message on an individual invoice that applies specifically to the invoice and customer I'm writing it to.
      I'm at a loss on how to achieve this as I can't see what I'm doing wrong - I really thought it'd be a 5 minute task, but it's proving frustratingly difficult to achieve and I've wasted hours trying to do it..
      And advice on what to do would be gratefully received.



      PS: This is a Modified FM Starting Point Database if that helps  running os OSX 10.10
    • Prospects v Customers
      By Simon UK
      I'm developing for a service company that has a telesales and a field sales team.  They then have a service team that visits customers and services products on site.
      Both prospects and customers are currently in a table called 'companies' and have a simple flag (dropdown list) to indicate the difference.  Challenge is that the table has grown to 124 fields with some of the fields only relevant to either Prospects or Customers.  Remarkably I have never needed to create 1:1 relationships in such a scenario but I'm thinking of doing so.  Would it be advisable?  I'm thinking specifically it may lead to performance improvements on list layouts with some 20,000 prospect records being loaded?
      Also having not used this technique before is there a way of having the related 1:1 records in the separated tables auto create when I create a record in the main company table?  I'm thinking this might be a really stupid question but I'm quite tired and just can't see it?
      I look forward to your opinions.
      Thank you,
    • Filemaker Server 14 Installation Snafu
      By Mikhail
      I have a problem with filemaker server 14, when I install it this happened: 
      I don't know what is causing this, help.
    • Can't crack a relationship
      By FrancoFranco
      Hi all,
      I've got a problem I've been struggling with for a few days now and I'm hoping someone here can help. Apologies if this is actually quite simple. I'm not a complete beginner with FM, but far from advanced.
      Anyway, here's the problem: I have a parent table called Collections, and a child called Items. 1 Collection can have many Items. I also have a table called Requests. This table should allow a user to request a selection of items from a particular collection, so that these items can be physically delivered from storage to our premises. Each Request should be unique and retained as a permanent record, allowing us to have a history of when Requests were made and what Item they were for.
      This is where my problem starts. I've attached an image showing how the relationships are set up between tables. My problem is that even though on the Request form I can bring up a checkbox set of items that changes depending which Collection has been selected (drawn from a value list), when I create a new request for that Collection the previous Request' selections are already checked, and if changed will effect the previous record. How should this relationship be set up to avoid this? I'd assumed I should use a join table at some point, but wherever I try this I'm told I can't have more than one relationship instance between any two tables...
      To take it a step further, often a Collection will have so many Items that the checkbox set field isn't anywhere near big enough. Without a scroll bar option on checkbox sets, it seems to me that in the Requests form that field should in fact be a portal, which will allow a scroll bar. In this instant, how would this effect the above relationship problem?
      Thanks again for the help, and taking the time to read this!