2 Replies Latest reply on Jun 24, 2015 7:57 AM by grouper

    Disabling the last "delete portal row" button



      Disabling the last "delete portal row" button


      Hi all

      I have a DB with many portals and in virtually all of them I have created a "delete portal row" button, that appears on each row. The last row, which is always the empty one, includes this button as well, and if users click on it, they still get a message asking for confirmation of deletion of the empty (essentially non-existent) row.

      Is there any way to make this button unclickable (or not performing the delete script) only for this row to avoid this confusion?

      And another relevant question : if a user clicks the delete portal row button and then chooses "Cancel" in the message box asking for confirmation, this is followed by another message "Delete portal row has been cancelled. Do you wish to continue with the script?" . Is there any way to prevent this second message from appearing after hitting cancel?


        • 1. Re: Disabling the last "delete portal row" button

          If you are using FileMaker 13 or newer, you can make the button disappear from the add row of a portal by using the new "hide object when" feature.

          If you use a text object such as the red "X" that I used to use for this, you can use conditional formatting to set the font size to a very large size (120+ points) to make the X disappear or you can just "grey out" the label text with you conditional format, but the button is still click-able and the cursor will still turn to a hand when you hover the mouse over the spot.

          You can use the perform script option on your button with Delete Portal Row as just one of the steps in that script. Now you can enclose your entire script in an if step that checks for whether the button in the add row was clicked to perform the script. IF so, the script exits without doing anything.

          If you are interested, there's a delete portal row script found in the Known Bugs List. This script still includes the "pre 13" code to keep from doing anything if the button clicked was in the add row. It is designed so that you can use it in any file to delete the portal row for any portal as all table/layout specific information is passed to it as a script parameter. It does a few more extras such as highlighting the relevant portal row and asking a confirmation message that includes data from the portal row to be clicked to make the process a bit more user friendly.

          • 2. Re: Disabling the last "delete portal row" button

            Thanks a lot Phil. I used the script in your linked DB and works perfect.