1 Reply Latest reply on Nov 16, 2012 8:41 AM by philmodjunk

    Deleting a Portal Row

    NewUser318

      Title

      Deleting a Portal Row

      Post

           I am writting a script to delete a portal row, however when I use the script it deletes the entire record that contains the portal. I am not sure what I am doing wrong. 

           The portal is an "attachments" portal where users can upload multiple attachments for one record. The delete script is supposed to delete only one portal row which contains an attached file. Here is the script i am writing:

           Set Error Capture [On]

           Show Custom Dialog ['Confirmation"; Get (AccountName) & ",are you sure you want to delete" & Get (ScriptParameter) & "?"]

           If [Get (LastMessageChoice) = 1]

                Delete Portal Row [No dialog]

           End if

            

            

           Has anyone else had this problem? Is there a solution to keep the script from deleting the entire record?

      Screen_shot_2012-11-16_at_9.58.34_AM.png

        • 1. Re: Deleting a Portal Row
          philmodjunk

               Open Manage | Database | relationships.

               Look for any relationships that link your layout's table to the portal's.

               Double click them and see if the "delete" option was selected for the layout's table such that deleting a record in the portal's table automatically deletes any related records in the layout's table.

               You may also be interested in the Delete Portal Row script found in the Known Bugs List database. It's a fully portable script--imports error free into any FileMaker database and the same script can be used with a "delete" button in the portal row of every portal in your file. (All layout and database specific information is passed as a script parameter to the script.)