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 Martin Pineault
      Hi,
      I have a configuration table (named 'Usager actif') with 'Projet ID actif' and start/end date values (field name 'Bilan date début' and 'Bilan date fin') linked to a timesheet table (named 'FTemps lié Projet bilan') to show only the records that match, according to the following relation:

      This table is also linked to a step table (named 'Étapes lié FTemps lié Projet bilan') to show a list of steps used by the timesheet table (named 'FTemps lié Projet bilan'), base on the following relation:

      So the last table (named 'Étapes lié FTemps lié Projet bilan') is shown in a portal and it's working correctly (show only two steps used, for all the timesheet records). But I wanna show the total time used for each step (first step is 5 hours, and last one 95 hours). It's working correctly if the start/end date included all timesheet records. But if I shrink the ending date (removing 2 hours from the timesheet in step 2), the total time by step still show all time since the context does not follow from timesheet table to the step table in relation.
      I still see 5 hours for step 1 and 95 hours for step 2 (should be 93). The total time for all step is now 98 hours, since the ending date has been shrink (removing 2 hours on step 2).
      How can I do this (hope fully I'm clear enough)?
    • By NewBoard
      I am currently building a database to handle the inspection sheets used by our Quality lab. Here is the relationship layout:

      For each revision on the Revisions table, I have a differing number of Dimensions that need to be measured (some parts/revs will have 5 dimensions, while others will have 15). Each dimension has a specified type of instrument used in measurement, and a max/min value. The instrument used is a drop down menu that references a list of instruments/gages that we use.
      Here is how I have my inspection sheet currently laid out:

      The portal on the left points towards my dimensions table. It shows the data corresponded to the specified Part Number and Revision level. The data contained in this portal is uneditable from this form. The portal on the right points towards my RecordedDimensions table. It will store data that will correspond back to the Lot# associated with that inspection sheet.
      I also have a table that pairs all the different types of instruments we use, with their corresponding gage ID's:

      Now I would like my user to be able to click on the dropdown box under Instrument#, and that drop down box will only show the Gage ID's for the specified gage. So, if on the dimensions table, a dimension calls out for Digital Micrometers to be used, then when my user goes to select the instrument ID (which is saved in the RecordedDimensions table) it will would allow them to choose 151, 152, 153, 306, 324, 330, and 331.
      Please let me know if I have not provided enough information/pictures, I will gladly provide more.
      Thank you in advance for any assistance you can offer me!
    • By Auraboros
      Hi...I have created a database using a "modified" anchor buoy method and so far everything works great...but...I have a portal in a "join table" that works fine...however, my button that is supposed to open the record in the portal row does not function...it returns nothing. The records are indeed related (see RG) as the fields show up from the related table without relational conflicts, but this button that is supposed to open the "library" table with the related record pulled up simply does nothing. 
      I have attached the DB. Also a screen shot of the table where the portal is (it is actually a join table layout, this may be the problem). I don't understand how the button (with the little arrow) does not go to the table that the actual portal record, which IS related because I see it show up on the portal row...what is not right here?
      Thanks!
      Todd


      **MusicalAmericaPRESUB copy.fmp12
    • By Tony Morosco
      I'm a botanist, and the tables I am working with are for tracking botanical garden collections. The data represents plants in the garden, and the plants are tagged and show up in the database.  The tables I am working with were created in FMP 7, and I'd like to open them up in FMP 11 (or later.)  The system hasn't been used in years, but still has valuable information.
      One of the tables is giving me problems using the FMP convert and recover commands.
      These tables are all inter-related.  The main table is the Accessions table, which contains records for all of one kind of plant, from the same source, received on the same date.  It is basically a museum standard.
      The other tables are related to each other through this one main table.  The Species table is related to the locations table through the Accessions table. 
      (i.e.  table A relates to table C through the table B, the intermediary)  
      From the Locations table, we can't see the the species information unless the accessions table is present.
      When issuing the open command on the main table to convert the database to FMP 11, I get the message:
      "Accessions.fmp7" is damaged and cannot be opened.  Use the Recover command to recover this file. When using the Recover command from v. 11, I get another message:
      WARNING: problems were detected while recovering the database.  Please review the Recover.log file to see where problems were found and their severity.  The recovered file should NOT be used going forward; copy only the most recent work from it into a backup copy of the original file. Recovery results:   File blocks: scanned and rebuilt 563 blocks, dropped 214 invalid data blocks.   Schema: scanned fields and tables, 1 items modified   Structure: scanned; 1 items modified   Field indexes: rebuilt  
      Opening the recovered database, there are only three records present.  There should be hundreds.  So obviously I am looking on how to wrangle this database open.
      I've attached the log file here, as well as the database structure map.  
      The other files have converted just fine.  But since the main table won't open, we are kind of stuck.
      I can share the files with you through Dropbox or whatever, if needed.
      Please let me know any thoughts you have, either basic or advanced.  And ask for any clarifications or additional questions.   :-)  
      Thanks!
      -Tony
      Recover.log

    • By Guy_Smith
      I am trying to set up a database to calculate and report exhaust emissions from diesel engines and am stumped at Step #1:  The infamous Entity Relationship Diagram!
      I am looking at a few thousand engines and need to calculate how much of what kind of pollutants they kick out into the air.  I have spreadsheets that list the Year of Manufacture, the horsepower, the serial number, how long the engine ran during a given year and how much fuel it consumed during that year.  I also have some spreadsheets that list what the Emission Factors, usually expressed in pounds per hour operated or pounds per gallon of fuel consumed, for each of the two dozen chemical compounds I’m interested in tracking.
      Those emissions are relatively simple to calculate:  Multiply the Emission Factor times the number of hours operated (or times the gallons of fuel consumed) and we’re done.  Except for the fact that the Emission Factors are based on the Year of Manufacture and, in some cases, the horsepower rating of the engine, so I have to circle back around to the Engine table:  I don’t know how to connect the emission factor for, say, Arsenic to a specific engine, say a 154 hp Chevy made in 2014,  based on that engine’s year of manufacture and hp rating.
      So my ERD keeps looking something like this:  Engines --->Emission Factors--->Engines   or   Engines ---<  Emissions >---Emission Factors--->Engines
      My computer keeps puking ones and zeroes all over my keyboard when I try either setup in my Relationship Graph!
      The only other way I can think of accomplishing these seemingly simple calculations is to write a boatload of scripts with variables, but I’m not even sure I could come up with all of the combinations/permutations involved.  And, unfortunately, I can’ even spell SQL, let alone know how to execute one of ‘em!
      I have attached a (simplified) copy of the spreadsheets I currently use to better explain my problem.  I hope one of you will find this to be mind-numbingly simple and explain how it should be done.  Thanks very much for your time and consideration.
      Sincerely,
      Guy
      Engine Emissions Calc Sheet MOD for FMF.xlsx