3 Replies Latest reply on Apr 14, 2014 9:08 AM by philmodjunk

    Scriptstep Delete All deletes all records outside the foud set

    firebase

      Title

      Scriptstep Delete All deletes all records outside the foud set

      Post

           i have a script that finds a set of records and after that i have another scripted button that should delete the foundset by using delete all, but its doing what its name sayes, its deleting all records incl. the ones outside the found set.

            

        • 1. Re: Scriptstep Delete All deletes all records outside the foud set
          philmodjunk

               Delete all records should delete only the records in the found set. If you are getting records deleted that were not in the found set, there is either something not right with this script, or a "delete" option in Manage | Database | relationships is causing a cascading delete that is clearing the entire table.

          • 2. Re: Scriptstep Delete All deletes all records outside the foud set
            firebase

                 i checked all relationships in the relationship windows. but the delete button is allways off.

                 is the function in the menu delete found set doing exactly the same like the script step?

                 because this one works like it should be.

            • 3. Re: Scriptstep Delete All deletes all records outside the foud set
              philmodjunk

                   The script step works exactly like the menu option.

                   Something in your script or a different script performed by a script trigger tripped by your script is changing your found set to include all records before this delete step is performed.

                   You might want to post your script so that others can examine it for possible issues.

                   To post a script to the forum:

                     
              1.           You can upload a screen shot of your script by using the Upload an Image controls located just below Post a New Answer.
              2.      
              3.           You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here. (with this approach, you can get multiple script steps on the same line, please edit the pasted text by inserting some returns to separate those steps.)
              4.      
              5.           If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
              6.      
              7.           If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format.