1 Reply Latest reply on Sep 2, 2016 1:12 AM by Johan Hedman

    Perform Script on Server deleting records from an unrelated table




      I have a layout A with table(FM_Reports) wherein when the user enters a Work Order Number, I do a few column matching using ESS tables and then add them to two separate tables Sample_Specification_Exact and Sample_Specification_General. These two tables are related to the layout table(FM_Reports).

      After all the search and matching are done, the two table values are displayed in a portal in the same layout, Layout A.


      When the user clicks on any of these two table rows, the user is taken to Layout B, answers a few questions, clicks Submit.


      When they click Submit,the answers they entered are stored in the database using PSOS Script step, since I am running the file in FM Go.


      Here is where something weird happens,  When PSOS is done executing, the records from tables Sample_Specification_Exact and Sample_Specification_General are automatically deleted. I gather that those records that belong to Portals are being deleted.


      I checked the Total Record count of the two tables before and after PSOS and it is clearly after PSOS that these table records are deleted.


      I don't know why this is happening or how to resolve it, but I still need those two table values after performing the PSOS Script step.


      Hope I have made my problem clear.


      Any help would be greatly appreciated.

        • 1. Re: Perform Script on Server deleting records from an unrelated table
          Johan Hedman

          Do you have any Triggers in your system. When you run PSoS OnFirstWindowOpen will run and all OnLayoutOpen as well. Make sure you handle those correctly so that you end up on the right layout before you run. PSoS dont know where you FileMaker Pro user are in your system. It opens up like it was the first time you open the solution.


          Then always check before going to Go to related Records that you actually have any records there. Do a If() to check if there is any records there. If not, then dont do Go to related records.

          1 of 1 people found this helpful