6 Replies Latest reply on Jul 31, 2017 4:43 PM by sidetrack_ca

    Trying to delete single record deletes entire found set

    sidetrack_ca

      I have a popup button that displays all records that match an entry / selection from a drop down field.  The user selects the field from within the drop own and the popup shows all records that match this search.  So lets say two records show up.  You can click on one of the two and that one is displayed in the layout and the record ID reflects that I have selected a single record.  Even the navigation bar shows 1/6 for records. 

       

      Now I want the user to press a delete button and have just that record deleted.  The problem comes into play when the user hits the delete button.  It deletes both records that have the same search criteria.  I just want it to delete the active record. 

       

      Here is my script to delete the active record:

       

      Delete Record/Request [With dialog off]

      show alll records

      go to Record/Request/Page [ last]

       

      thats it.  Thank you all for your help and guidance its been amazing!

       

      Rob

        • 1. Re: Trying to delete single record deletes entire found set
          philmodjunk

          Best guess is that you have the "delete" option specified in one or more relationships setting up a cascading delete that deletes the other record(s) when you delete the record shown on your layout.

           

          You mention that you are finding "matching records", so I'd first look for any relationships that match on the same field and double click relationship lines to look for enabled "delete" options. Note that a completely different part of your relationship graph that happens to refer to the same data source table via a different table occurrence could be the cause of this issue so you have to check ALL relationships linking to any table occurrences with the same base or data source table.

          • 2. Re: Trying to delete single record deletes entire found set
            ErikWegweiser

            Hi, Rob:

             

            I would first check to see if there are any relationships in the solution that would cause multiple records to be deleted, in "cascade" fashion. Edit each relationship to see if the "Delete related records..."option is checked off on either side. The purpose of this is, for example, to have all Line Item records for an Invoice automatically delete if the parent Invoice record is deleted.

             

            1 of 1 people found this helpful
            • 3. Re: Trying to delete single record deletes entire found set
              patricia

              Check your relation. You are deleting a founds set. Instead of deleting with the found set. Omit the record you do not want deleted and then delete the record. Show the dialog so that the user can see they are about to delete a record. Check your relationship that you do not have delete active.

               

              patricia

              1 of 1 people found this helpful
              • 4. Re: Trying to delete single record deletes entire found set
                techt

                Are you displaying the items in a portal on the pop-over? If so, you can just use the Delete Portal Row and that will take care of it. If it's a List view or something else, you could pass a script parameter of the primary key for the record they selected and delete the record based on a find in a temp window.

                1 of 1 people found this helpful
                • 5. Re: Trying to delete single record deletes entire found set
                  philmodjunk

                  Neither omitting and deleting nor deleting a portal row will help if it's a relationship based cascading delete. This is an option that's very powerful and useful for maintaining data integrity, but like all powerful tools, must be used with care.

                  • 6. Re: Trying to delete single record deletes entire found set
                    sidetrack_ca

                    Philmodjunk,

                     

                    You were correct.  I had a join table and I thought I had to have the box checked to allow deletion in the join table if there was a deletion in the regular table.  So when i was deleting one of the records there was a relation based on category which of course both records were in.  The result was the deletion of all records within the same category.  I removed the checkbox to allow deletion in the relationship settings and all is good.  thank you everyone for your responses it has made me consider how i post things in an attempt to make them better understood.  Thank you again for all of your time!


                    Rob