1 2 Previous Next 17 Replies Latest reply on May 8, 2017 10:31 PM by synergy46

    FM 15 adv portal row delete

    synergy46

      I have a current and previous version of the same program.

       

      There is a SETUP layout that has mostly global fields on it.

      (Organization Name, address, city, state etc....)

      There is also a dues structure called MembershipTypePopup which holds information in a portal linked to the Global table using a 'X' relationship.

       

      Here is the weird part.  In the Current version the script that deletes a row in the MembershipTypePopup Table, when fired, deletes all rows.

       

      But, when I run the same script in the Previous version, it does NOT delete all rows; it acts as expected.  Yes, I have pasted the working script into the new version and it is no help.  Also, I can step through the New version script and see that when it gets tot he Delete Row step, all rows disappear when it encounters the Delete Portal Row script step.

       

      What am I missing???

       

      DeletePortalRow.png

        • 1. Re: FM 15 adv portal row delete
          user19752

          Did you check relation option "delete related records..." ?

          • 2. Re: FM 15 adv portal row delete
            synergy46

            It doesn't matter if it is checked or not....

             

            R

            • 3. Re: FM 15 adv portal row delete
              synergy46

              The mysterious part is that as I step through debug (as shown above), when I get to the DELETE PORTAL ROW command, ALL portal records are deleted.... And this script WORKS in an older version of the program.

               

              Copying the working script to my 'new' version, means the Delete Portal Row command no longer works.  I think this means something else is affecting the command.  I checked:  the relationship 'delete' option and it doesn't seem to matter.  Again, as I step through the script, it fails at the Delete Portal Row step..... I am mystified..... Thanks

              • 4. Re: FM 15 adv portal row delete
                nicolai

                The main problem, I think,  is that you do not reference the portal explicitly. Give it a name and go to object or use "Go to Field" and target the field from the portal.

                 

                Apart from this, check the records are in fact deleted and not just become invisible. Check if there is a filter on that portal.

                 

                It could be that the field in the current record you use for the relationship accidentally got stretched/moved over the portal. Make sure there are no hidden fields over the portal.

                • 5. Re: FM 15 adv portal row delete
                  philmodjunk

                  It doesn't matter if it is checked or not....

                  It, (the delete option in the relationship), does indeed matter. In fact, you need to check:

                   

                  1. Both sides of this relationship to make sure that deleting a portal row does not delete the parent record.
                  2. All occurrences of this portal's table in your relationship graph for "delete" options. It's conceivable that a delete option elsewhere in your relationship graph is responsible for a cascading delete.

                   

                  I once accidentally selected "delete" on both sides of a relationship used for a portal. When I deleted the portal row, the delete option on the parent side then kicked in and deleted the parent record. Deleting the parent record then caused the delete option on the child side to delete all the other records initially listed in this portal...

                  1 of 1 people found this helpful
                  • 6. Re: FM 15 adv portal row delete
                    siplus

                    It is always a good idea to precede steps like Go to portal row / delete portal row etc. with a Go To Object after naming your portals in Layout mode. One day you can end up with 2+ portals on the same layout and you risk to address the wrong one.

                     

                    A software like FMPerception can list all your relationships and you see at a glance which ones have the delete attribute set.

                    • 7. Re: FM 15 adv portal row delete
                      synergy46

                      I have done that and it is of no help.

                      So, I have created a List layout based on the Portal table (MembershipTypePopup) and put the portal fields on it.

                      I have an Add button that runs a single line script of Add Record and...

                      I have a Delete 'X" button that runs a single line script that Delete Record...

                      I also 'killed' the relationship so that the 'table' is stand alone without relationships.

                       

                      Add works.

                      Delete "X" causes the entire table to be deleted.... (isn't this weird)

                       

                      This seems to indicate that the problem is NOT in the relationship.  And, it is not in the delete script.

                       

                      layoutb4.png

                      I press the red 'X' button which runs a script...

                      ...

                       

                      layoutAfter.png

                       

                      which results in ALL records being deleted... huh?

                      LayoutAfter2.png

                      • 8. Re: FM 15 adv portal row delete
                        siplus

                        can you upload a clone of your database ?

                        • 9. Re: FM 15 adv portal row delete
                          philmodjunk

                          It suggests to me that you have a delete option selected elsewhere in you relationship graph that is causing a cascading delete.

                          • 10. Re: FM 15 adv portal row delete
                            synergy46

                            Isn't that possibility irrelevant since my table (pictured above) is a stand alone table without relationships to anything?

                             

                            R

                            • 11. Re: FM 15 adv portal row delete
                              synergy46

                              I should also mention that if I do NOT press the red 'x' but instead choose from the Menu:  Record Delete...

                              I get the SAME result.

                              • 12. Re: FM 15 adv portal row delete
                                synergy46

                                Here is a link to the zip file:

                                LodgeMembership999NEW.fmp12.zip - Google Drive

                                 

                                You get to the Open Window (problem layout) by clicking the "Open Type Window"

                                 

                                OpenWindow.png

                                Also, there is a small script called STATUS ON that will make for quick access to edit mode in a layout.

                                Your thoughts are appreciated.  Thanks.

                                • 13. Re: FM 15 adv portal row delete
                                  synergy46

                                  Yes!  I had overlooked a TO that had been 'renamed'.  After turning of the 'cacading delete' it worked.

                                   

                                  Thanks for the help!!  Excellent as usual.

                                  • 14. Re: FM 15 adv portal row delete
                                    philmodjunk

                                    It can be helpful to use a naming convention or color scheme that helps you identify all the TO's that share the same data source table. You can make all TOs with the same data source table the same color, or you can use a naming convention such as including the source table name or an abbreviation of it in all Caps.

                                    1 2 Previous Next