14 Replies Latest reply on Jan 12, 2012 4:41 PM by BruceHerbach

    Portal - How to turn off delete?

    BruceHerbach

      If a user is in a portal row and clicks the delete button on the key board, I'm getting the message "Permenantly delete this one related record". How do I set this up so that the message doesn't show and the user can't delete the record?

       

      The portal is set up with the "Allow deletion of Portal records" check box cleared. So I thought they wouldn't be able to delete the records. This came up because a user hit the delete button by accident and then clicked the ok button. deleting a record that should not have been deleted and of course causing all of the related issues..

       

      In this case there is only 1 field displayed in the portal row and it is actually set up as a button that takes the users selection and sets a number of options. Deleting the source of the selection is not a good thing.

       

      Thanks

      Bruce Herbach

        • 1. Re: Portal - How to turn off delete?
          taylorsether

          Sounds like this could be handled in the privledge set of the user. Have you tried  to add custom privledge for the user on which layouts they can access and what type of control they have?

          • 2. Re: Portal - How to turn off delete?
            BruceHerbach

            Hi,

             

            That may help.  In this case the user in question was one with full access.  He just hit the wrong button.  I was hoping for a quick/easy layout trick.  I'm just not seeing one.

             

            I think in part that this is exacerbated by the fact that there are no fields that the user can enter.  Just the one set up as a button.  I notice that on other layouts/portals when the user lands in a field they can edit,  the delete key just deletes characters,  not records. 

             

            Have to think about how to implement,  but this may be a solution.  Change the button to a field with an on enter script trigger.  Ignore/empty the field they enter but update with the information needed. 

             

            Thanks

            Bruce Herbach

            • 3. Re: Portal - How to turn off delete?
              comment

              BruceHerbach wrote:

               

              If a user is in a portal row and clicks the delete button on the key board,  I'm getting the message "Permenantly delete this one related record".

               

              ...

               

              The portal is set up with the "Allow deletion of Portal records" check box cleared. 

               

              Perhaps you should check this setting again.

              • 4. Re: Portal - How to turn off delete?
                taylorsether

                ah ok, I wonder if you could some how capture if the action on your button comes from the keyboard.

                • 5. Re: Portal - How to turn off delete?
                  Stephen Huston

                  Hi Bruce,

                   

                  You could also handle this via Custom Menus by changing the behavior of the Delete command to run a script, or just removing that item from the custom menu. (Such as script must absolutely NOT be run in Full Access mode!)

                   

                  You could even leave the Delete command in the custom menu for Records but just disable its keyboard shortcut for the Delete command.

                   

                  If you had turned OFF the allow deletion of portal rows it sounds like a bug that this even came up as an option, so you may need a work-around with either permissions or Custom Menus and scripts.

                   

                  Stephen Huston

                  • 6. Re: Portal - How to turn off delete?
                    BruceHerbach

                    Hi,

                     

                    I think I have a viable work around.  I set up a field with a size of 1 X 1 pixels with an empty popup menu.  When the user clicks the field/button all of the settings are taken care of and then a goto object puts them in the popup menu field.  The see a 1 pixel white spot which isn't noticable.   If they hit the delete key nothing happens.  If they click on the field,  they get a message that the list is empty,  but at 1 X 1 it's hard to hit.

                     

                    If they click on the button/protal row a second time,  they end up entering the row.  At this point they get the dialog about deleting the record if they press the delete key.  So the work around is not fool proof,  but they have to work at it a bit to produce the issue.  Once the script has run,  conditional formatting changes the back ground of the button so they know it has been selected.  So no reason to click a second time.

                     

                    I'm not sure if this qualifies as a bug,  unless the setting in the portal setup is trully being ignored.  I'm open to suggestion on should I report this as a bug.

                     

                    Thanks to everyone for their suggestions.

                    Bruce Herbach

                    • 7. Re: Portal - How to turn off delete?
                      comment

                      BruceHerbach wrote:

                       

                      I'm not sure if this qualifies as a bug,  unless the setting in the portal setup is trully being ignored.  I'm open to suggestion on should I report this as a bug.

                       

                      Why don't you post your file?

                      1 of 1 people found this helpful
                      • 8. Re: Portal - How to turn off delete?
                        JesusSanchez

                        Hi Bruce, try to turn off the allow delete portal rows option, configure a script to go to related record and delete it in the original table. You can configure this script capturing the account name or the privilege of user.

                         

                        Maybe you should attach your file.

                        • 9. Re: Portal - How to turn off delete?

                          Hi Bruce,

                           

                          I cannot replicate this behavior. It would be good to know your OS and FM versions.  I certainly would not suggest taking such an usual approach (1x pixel) to fix something which may or may not be broken as you suspect.  It would be good to review the file, as Comment mentions.  Are there any triggers attached to that layout at all?  Are Users accidentally tabbing through a field with a trigger or are they tabbing to a button (and then hitting enter to activate it)?

                           

                          I would work real hard to figure out the issue.  If you do not take the time now then 1) you will be stuck with less than the best which may simply mask the issue and 2) you will not learn how to stop it from happening again.  It should be pinned down and we are willing to help you work through it. 

                           

                          LaRetta

                          • 10. Re: Portal - How to turn off delete?
                            BruceHerbach

                            Hi LaRetta,

                             

                            Atached is an example of what I am talking about.   Open the attached database, click on one of the portal rows.  The result field at the bottom updates with the value from the portal row.  Click the delete buttom on your keyboard and it brings up the dialog,  "Do you want to delete the related record".

                             

                            This was done in FMA 11.0v4 on a MacBook Pro running Snow Leopard.

                             

                            Please let me know if you think this is a bug and I'll report it.

                             

                            This is from an older implementation,  given the number of options,  it could be done with a field set up as a radio button set and a script trigger.  I'm holding of on this change because the client likes the look in the current version.  Instead of displaying the result, the portal row highlights using conditional formatting.

                             

                            Thanks

                            Bruce Herbach

                            • 11. Re: Portal - How to turn off delete?

                              Hi Bruce,

                               

                              A commit resolves it; it's because you end up in the text field.  But it should not allow deletion in the portal and it does for me as well so it is not platform specific (testing on Windows).  I guess I have just never noticed this and it is certainly unexpected behavior

                               

                              It works as expected in vs. 9.0v3.  I am not one to consider something a bug; who am I?  But I would certainly highly suspect that it is and I suggest that you post in the bug forum http://forums.filemaker.com/hives/1eea103f05/summary here.  Maybe others have different perspective. 

                               

                              Message was edited by: LaRetta - if you do not wish to commit the child or parent records then you can always end your script with Go To Object [ dummy ] ... place a text object named dummy on top of your layout.  Conditionally format it to disappear except in windows mode 4 (layout mode).

                              1 of 1 people found this helpful
                              • 12. Re: Portal - How to turn off delete?
                                DavidJondreau

                                I've been playing around with the file.. I am able to replicate the issue described. I think it's related to the button, record commit, and the portal becoming active. If I make the button slightly smaller, so I can select the portal row without activating the button I can toggle the behavior.

                                 

                                 

                                If I select the portal without clicking the button, the behavior goes away, until I commit the record. Then clicking the button and then delete causes it to happen again.

                                 

                                Weird and I would submit a bug report.

                                 

                                Others have mentioned workarounds. Here's how I would handle it in a script:

                                 

                                Grab the portal name in a $var (if there's more than one, you'll probably have to pass the portal name in a parameter)

                                grab the active row in a $var

                                commit the record

                                go to object $portal

                                go to portal row $row

                                • 13. Re: Portal - How to turn off delete?
                                  comment

                                  This is definitely not the expected behavior - and as LaRetta noted, it is new since version 10. If you check, immediately after performing the script the active layout object is the portal and the clicked row is the active portal row - but the row is not being highlighted. It seems that this creates a vulnerablility that bypasses the restrain put upon the portal - somewhat similar to having a button in the portal that expressly deletes a portal row.

                                  • 14. Re: Portal - How to turn off delete?
                                    BruceHerbach

                                    Hi,

                                     

                                    I want to thank all you for your input on this.  Based on the suggestions above,  I was able to get the portal row,  then after doing the updates have the script gotoobject, gotoportal row and then committ the record.  This made the row active  to filemaker and I no longer end up with the delete record dialog.

                                     

                                    I'll submit a bug report

                                     

                                    Bruce Herbach