AnsweredAssumed Answered

FM13>FM15: Script to delete portal row suddenly deletes master record in FM15

Question asked by wendy on Dec 13, 2016
Latest reply on Dec 15, 2016 by wendy

We went live last night from FMS13 to FMS15 on an iMac running El Capitan and the latest version of FMS. PC clients were upgraded to FM15. Mac clients were left at FM13.0.9 until we upgrade the Mac OS from Mavericks.

 

This is a legacy database with 21 files and ...inherited programming. The script with the problem was created in 2009, at a time when the database version was FM8. The script is initiated by a button in a portal row to delete that join record/row. The button apparently "loses" context and instead deletes the master record. (I did preliminary testing but if it occurred there, I missed it.)

 

I temporarily reverted the PC user who run this process from FM15 back to FM13.0.9. It works fine in FM13 (accessing records now served by FMS15).

 

But I'm having trouble getting my head around this programming/design and am not sure what to do to solve the problem in FM15. (And am hoping it won't show up elsewhere!) Can anyone help?

 

The troubled script and details:

 

Allow User Abort [Off]

Set Error Capture [Off]

If [IsEmpty (DD_PutUP_JOIN::DieDetail_DieNumber_fk)]

   Show Customer Dialog ["Selected Row Is Empty";

   "Please select a row that contains a die number."]

Else

  Show Customer Dialog ["ALERT!";

     "Are you sure you want to DELETE the die  \"" &

     DD_PutUp_JOIN::DieDetail_DieNumber_fk &

     "\"  from this PutUP?"                               (Buttons are Cancel with Commit Data checked, and "DELETE".)

  If [Get {LastMessageChoice) = 1]

     Exit Script [Text Result: ]

  End If

End If

Delete Record/Request (With dialog:Off]

-----------

The user creates the master PutUp records, then uses this layout/portal to both add and remove die records from the PutUp record. Similar in function to an Order record with line items. Scripts to add dies to the portal are working.

Script was/is set to run with full access privileges. Layout Context is table DD_PutUp. Portal shows related records from DD_PutUp_Join; this is a join table between the "DieDetail" table and the DD_PutUp table. The portal setup allows deletion of portal records.

Outcomes