1 2 Previous Next 23 Replies Latest reply on Mar 10, 2012 3:22 AM by GuyStevens

    Delete Portal Row Issue

    JLG

      Title

      Delete Portal Row Issue

      Post

      I am having an issue with "Delete portal row" on my program I just placed on Filemaker server 10.  The program works fine under Filemaker Pro10 and Advanced 10.  I have several portals located on a tabbed layout with a button in the portal rows for deletion.  The button runs a script that goes to the current portal row and selects it (so it highlights it for the user), then displays a dialog box asking the user if they wish to delete, then based on the answer uses the delete portal row statement.  No issues whatsoever running it multi-user or standalone with pro, but now it is intermittent with server.  I can create several portal records, try to delete them and some of them refuse to delete.  The proper row highlights, but just will not delete.  Running debugger doesn't show an error on the script.  I tried changing the button to an action step delete portal row verses scripting and it does the same thing.  Only way I can get the portal record to delete is to re-start the client copy then delete it.  I searched and did not find any issues related to deleting portal rows with server.  Anyone have any ideas or known issues?

       

      Thanks,

      -=J

       

       

       

      Win XP Pro SP3

      Filemaker Pro 10

      Filemaker Advanced 10

      Filemaker Server 10

        • 1. Re: Delete Portal Row Issue
          philmodjunk

          I use this approach to delete portal rows on a server hosted file with no trouble.

           

          Have you checked your most recent copy by taking it down off the server and opening it with filemaker? ( I wonder if you have a bad file index or other file problems.)

           

          Have you tested (step through it with debugger) an alternate script, such as one that:

           

          switches to a layout of the portal records

          performs a find to isolate the record to be deleted

          Deletes the record

           

          If that script also fails, then you might have a damaged file.

          • 2. Re: Delete Portal Row Issue
            JLG

            Thanks for the info, I will go and try the alternate script path.  I have to eat crow on it being an update to server issue.  I was basing my information on user input and they usually don't delete a lot of portal records at one time (no complaining so it must work...right?).  So I decided to go back test this issue using Pro and multi-user.........to my surprise it was there too.  Does not occur on the host computer, just clients.  So apparently I am having an issue deleting portal records in any multi-user environment.  I do use the same script across all portals, maybe I just don't understand the process.  I will try your script method.

             

            BTW, since this is not server related, could a mod please move this thread to Filemaker Pro section please....thank you and I appologize.

             

            -=J

            • 3. Re: Delete Portal Row Issue
              philmodjunk

              Moved as you requested....

               

              Since Multi-User vs. SIngle User (or Host) is the key factor, we need to look for differences based on that detail.

               

              The most obvious difference between single user and multi-user environments are the way in which global fields behave. Any global fields involved in this process?

              • 4. Re: Delete Portal Row Issue
                JLG

                No, not using any global fields. 

                 

                It doesn't make any sense to me what is acting differently in single verses multi user environment.  I even tried using the default delete portal row behind the button and had the same thing happen.  I am puzzled.  All of the portals have the button checked for allow deletion of portal row.  My luck, it is one little tiny thing somewhere affecting the entire database.  But being it happens at random, I am at a loss.

                 

                Thanks,

                 

                -=J

                • 5. Re: Delete Portal Row Issue
                  philmodjunk

                  Just to rule out possible file corruption issues, recover a copy of your file and see if it behaves the same. If the recovered file works, or recover reports possible damage to the file, replace the file with an undamaged back up copy.

                  • 6. Re: Delete Portal Row Issue
                    JLG

                    Guess I am screwed.  I did a file recovery and results were 3 structure items modified.  Stated "reset field formatting, calculation modified, this item changed".  No other problems identified.  Though the errors were not on a table that was giving me the headache.  The recovered file acted the same way.  Starting looking at my backups, this error has apparently existed for a long time.  Since I never knew the error existed, there is no backup that is up to date with all the modifications without the errors......great!  Time to go home and have a beer.

                     

                    -=J

                    • 7. Re: Delete Portal Row Issue
                      JLG

                      Well, I spent the morning completely deleting and rebuilding the 3 items creating the structure error.  My dbase now passes recovery with zero errors and everything works proper on the host computer.  Went to a client computer, again I can create several portal records and it stops allowing me to delete them after creating about 5 or 6 in a row.  I am at a loss.  Any chance you might could post an example of a small script for an alternate delete portal row as you described above?  Not sure how I make the correct portal record selected when change to the layout for the portal table to ensure the right record is deleted.

                       

                      Thanks

                      -=J

                      • 8. Re: Delete Portal Row Issue
                        philmodjunk

                        The alternate script is a test to make sure that you are able to delete the records displayed in a portal while ignoring the current layout design completely. You shouldn't need the script otherwise.

                         

                        Before running the following script, there's one more thing to check: Are the portal records in the same file or an external file? If external, do you have both files open with a full access password or are you running a script set to run "with full access privileges"? 

                         

                        The "Full Access" option only applies to the current file. If your script attempts to perform a action on another file that access privileges do not allow--such as deleting a portal record from another file--those actions are still not allowed.

                         

                        The Script (It assumes you have a serial number field to uniquely identify each portal record):

                         

                        Set Variable [$ID ; PortalTable::SerialIDField]

                        Go to Layout [PortalTable]

                        Enter Find Mode[]

                        Set field [ Portaltable::SerialIDField ; $ID]

                        Perform FInd []

                        Delete Record [no dialog]

                        Go To Layout [Original Layout]

                        • 9. Re: Delete Portal Row Issue
                          JLG

                          All the tables are in one file and the script has full access to run. 

                           

                          Yesterday afternoon I did discover what seems to be happening even though I don't understand why.  Are portal records supposed to be commited once you click into the next row creating a new portal record?  If that is the case, I have more problems as for some reason that is not happening on my database.  I have to click out of the portal area into another area of the layout before they are being saved.  As long as I clicked outside the portal, the delete did not seem to have any issues.  But even clicking from one portal to another portal did not cause them to save.  I had the delete script go to the layout for the related table and the newly created portal records did not exist on that layout.  So I assume that I need something in a script flushing or commited these records before I delete.  I did read somewhere about a technique of scrolling back one record and then moving forward to the original record to cause them to save.

                           

                          Newbie question about your alternate script technique.  When you relate tables, do you always use a serial field in addition to your relation key field?  I did not do that on all my tables since I did not see a reason at the time (now I do...opps..still learning here).

                           

                          Thank you for all your help.

                           

                          -=J

                          • 10. Re: Delete Portal Row Issue
                            JLG

                            Going to claim a victory here.  Not sure if this is the correct way to do this, but I placed a script trigger on each field within every portal for an on object save to run a script that performs only a commit record step.  So far it is working great.  If there is a better or more efficient way, please let me know.  Thanks.

                             

                            -=J

                            • 11. Re: Delete Portal Row Issue
                              philmodjunk

                              " When you relate tables, do you always use a serial field in addition to your relation key field?"

                              Only when I need to uniquely identify the records. In this case, a serial number field was a very simple, safe way to make sure that record the script deletes is the same record whose portal row you are trying to delete.

                               

                              Your need for a commit record step suggests something to check. What option for comitting records have you selected in layout setup... ? Any chance "save records automatically" is NOT checked?

                              • 12. Re: Delete Portal Row Issue
                                JLG

                                PhilModJunk wrote:

                                Your need for a commit record step suggests something to check. What option for comitting records have you selected in layout setup... ? Any chance "save records automatically" is NOT checked?


                                Yes, the block for save records automatically is checked.  It is odd why this is happening.  Just to check, I created a small test dbase and tried to replicate everything that is going on with mine using the same delete scripts and it worked just fine.  But I guess as long as the script trigger commit record is taking care of business I am thankful for that work around.

                                 

                                Thanks!

                                -=J

                                • 13. Re: Delete Portal Row Issue
                                  philmodjunk

                                  Yeah, but the "why is it needed?" issue is an itch I can't scratch. I'm concerned that some undiscovered issue in the design of your file and/or hidden damage might trip you up in a major way in the future. You wouldn't want your script to delete the wrong record--just to give one major possible negative outcome.

                                   

                                  Hmm, anything beyond a basic setup with the portal and relationships that might be involved? (More than one Table Occurrence between the portal's TO and the layout's TO. Fields in the portal drawn from other TO's besides the portal....)

                                  • 14. Re: Delete Portal Row Issue
                                    JLG

                                    PhilModJunk wrote:

                                    Yeah, but the "why is it needed?" issue is an itch I can't scratch. I'm concerned that some undiscovered issue in the design of your file and/or hidden damage might trip you up in a major way in the future. You wouldn't want your script to delete the wrong record--just to give one major possible negative outcome.

                                     

                                    Hmm, anything beyond a basic setup with the portal and relationships that might be involved? (More than one Table Occurrence between the portal's TO and the layout's TO. Fields in the portal drawn from other TO's besides the portal....)


                                     

                                    Well, the script always highlights the correct portal row before deletion, so I don't see a problem now.....fingers crossed....heheh.

                                     

                                    The only thing I can think of that might be interfering are other script triggers.  There are a few that activate timers and warning messages; they are on record modify triggers.  But there are two completely different sets of tables and portals with different triggers which had the same deletion glitch, so I don't see a correlation.  If memory serves correct from yesterday, I disabled those triggers while troubleshooting and still had the glitch.

                                     

                                    Also while I do use multiple TO's in certain places, they are not the tables or related to the ones where I have the problem.

                                     

                                    -=J


                                    1 2 Previous Next