6 Replies Latest reply on Jan 30, 2015 4:01 PM by openspace

    Deleting portal rows & script triggers

    openspace

      Good afternoon.

       

      I have two portals set up on my contact details layout. One portal allows the user to renew a contacts membership, the other creates a new donation. Modifying either of these portals runs a script trigger. I noticed when you delete a record from one of these portals the script will not run via the script trigger. I can force the script to run manually, but I would prefer that the script be triggered when you modify or delete one of the portal records.

       

      The user can delete a portal row by selecting it and clicking "delete record" or click the backspace key. I would prefer this rather than a little garbage bin button because my coworkers are anarchists at heart and would most likely ignore the icon and click the backspace key.

        • 1. Re: Deleting portal rows & script triggers
          electon

          A lot depends on how/ where the script triggers are defined and what they are supposed to do. If you need to do something with the selected row, do it before delete, otherwise after. I'm assuming there is a script capturing the backspace key press. Does it not work via that script there? If on FMPA you can use the script debugger to look at what actually is going on.

          • 2. Re: Deleting portal rows & script triggers
            erolst

            openspace wrote:

            The user can delete a portal row by selecting it and clicking "delete record" or click the backspace key. I would prefer this rather than a little garbage bin button because my coworkers are anarchists at heart and would most likely ignore the icon and click the backspace key.

            Force them to use your icon (to which, I assume, is attached a deletion script) by opening Portal Setup and disallowing record deletion.

            • 3. Re: Deleting portal rows & script triggers
              wimdecorte

              What trigger are you using and on what object?  To capture the keystroke you have two: onObjectKeystroke and onLayoutKeystroke.  Note that the will actually both fire on each keystroke.  Which one is your script attached to?

              • 4. Re: Deleting portal rows & script triggers
                openspace

                The script will automatically set tags for a user. Ie. if the user adds a donation, or a portal row, the script runs and updates the tag to "active donor." For some reason, when you delete the portal row by the backspace key or an icon the script triggers (from within the portal object) never trigger. It doesn't matter what I do, if I add a new portal line it still doesn't trigger.. or if I go to the next record it still doesn't trigger.

                 

                I also noticed that when you add the very first portal row it doesn't want to commit the record until a second portal row has been made...hence the script doesn't trigger until there are two portal rows.

                 

                I also tried putting a script on the layout "on exit" but it still doesn't trigger the script.

                • 5. Re: Deleting portal rows & script triggers
                  openspace

                  I just realized that it does the same thing with an icon. *face palm*

                  • 6. Re: Deleting portal rows & script triggers
                    openspace

                    Hmm..I've tried all of the triggers on the fields within the donation portal and the donation portal itself. I just realized that my other membership portal works perfectly. Which makes me think this is another relationships problem on my part.


                    Members portal displays records from memberships table.

                    The trigger updates properly.

                    contacts >-- memberships


                    Donations portal displays records from donations request table. Donations can be made by multiple donors.

                    The trigger doesn't update properly.

                    contacts --< donations request >-- donations

                     

                    I'm assuming that if I create a layout from the donations request table and place a portal within this new layout that displays records from the donations table...that I may be able to solve my problem? Or... is there a way to keep the user in the contact details layout, allow them to add a new record, and have the script update without dancing around?