Help to set up script for delete button in Portal...
I have a portal, where I have button that adds records into the portal. I've tried to make a button that will delete a record in the portal. I've been lucky enough to get some help allready with some script that should be attached to a button and it should delete a record, but it dosen't seem to work for me, im quite new to filemaker, and scripting is absolutely not my strong side... Help please... the script is as follows, and I have activated "allow deletion of portal records" in the portal setup:
Set Variable [ $RowExists; Value:GetValue ( Get ( ScriptParameter ) ; 1 ) ]
Set Variable [ $Label; Value:GetValue ( Get ( ScriptParameter ) ; 2 ) ]
If [ $RowExists ]
#Highlight the portal row to be deleted.
Go to Portal Row [ Get ( ActivePortalRowNumber ) ]
[ Select; No dialog ]
#Conﬁrm that button was not clicked by mistake.
Show Custom Dialog [ Title: "Conﬁrm Row #" & Get ( ActivePortalRowNumber ) & " Deletion"; Message: "Delete " & $Label
& "?"; Buttons: “Cancel”, “OK” ]
If [ Get ( LastMessageChoice ) = 2 /* OK was clicked */ ]
Delete Portal Row
[ No dialog ]
#Commit releases the focus from the portal row so that it no longer is highlighted.
#Created by Phil Caulkins