5 Replies Latest reply on Apr 29, 2014 5:00 PM by sorrow

    Perform Script on Server Deletes all records in layout

    sorrow

      Title

      Perform Script on Server Deletes all records in layout

      Post

           First time using this script function.  Just trying to get a simple script to run on the server from a button on a layout.  The script that I want to test is go to layout, create record.  That is it.

           What happens after pushing the button all of the records in this table are deleted.  It returns a 0 for the last error.

           Anybody have any suggestions?

            

           The server is 13.1 on a mac mini.  Client is 13.2 advanced.

           Thanks,

           Scott

        • 1. Re: Perform Script on Server Deletes all records in layout
          philmodjunk

               Can you post the actual script?

               Are you sure that perform script is performing the script that you think that it is performing?

               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.
          • 2. Re: Perform Script on Server Deletes all records in layout
            sorrow

                 This is the script I select on the script function 'Perform Script on Server.'  As you can see it is simple.

                 What happens is I have a button on a layout that is set to Perform Script on Server with this script selected, lets say I have 2 records in the table that this button is on, after clicking on the button both records are deleted.

                 I have also had the button perform a client side script that performs the sub script on the server this way I can see if any errors, the error that comes back is 0.

                 I know this is something simple but apparently I'm not smart enough to figure it out.

                 Thanks for your help.

                 Scott

            • 3. Re: Perform Script on Server Deletes all records in layout
              sorrow
                   Sorry, the pdf file I attached did not load, so here is the script below.
                    
                   Its called 'test'
                    
                   These are the steps:
                   Go to Layout [ “Entry” (Entry) ]
                   New Record/Request
                   Commit Records/Requests
                   [ No dialog ]
                   Exit Script [ Result: Get ( LastError ) ]
              • 4. Re: Perform Script on Server Deletes all records in layout
                philmodjunk

                     There is no way that this script can possibly delete any records. It cannot even omit a record from the layout's found set.

                     But go to layout might trip a script trigger set on the Entry layout and it can also trip any number of other script triggers on other. So my best guess is that you have a script trigger performed script that is deleting records rather than this script.

                     And from what little that I see here,  this does not look like a script that really makes sense as a script to perform on the server in the first place.

                • 5. Re: Perform Script on Server Deletes all records in layout
                  sorrow

                       You are right and you hit it on the head, I remember now.  I remember now that the script trigger is doing this.  I even remember someone else talking about this and I didnt even put 2 and 2 together.  Im a dummy.  :)

                       Anyhow this is not the script i really want, I just wanted to see if the records deleted with a simple script.  The script I will be running is a Credit Card processing script, but I needed to figure this out first.

                       Thanks for turning the lite on in my head!

                        

                       Scott