Welcome to PSoS – Perform Script on Server Part 2. In PSoS – Perform Script on Server Part 1 I showed how to create a record on the server and come back to a portal row to fill in the information. In Part 2 I decided to show how to delete a record using Perform Script on Server.
While we could use a Delete Portal Row script step I’m going to use 2 scripts to delete the record and as before when I get into future posts I’ll show how to do it in 1 script with more practical uses. So the below image shows the layout with 3 records, I’ve also added a trash can which we’ll use to delete the record.
Below is the Delete Contact script which I grab the contact id ( $CONid ) and pass as a parameter into the PSoS script step. I’ve also added a Custom Dialog to verify the record should be deleted.
Now lets take a look at the PSoS Delete Contact script. You can see all it’s doing is getting the contact id, going to the Contact ( CON ) layout and finding and deleting the record. If there’s an error it will get passed back. If no error then the record will just disappear from the portal.
So when we click the Trash icon we get this dialog.
After clicking Yes we get the result of a deleted record.
After clicking Yes we get the result of a deleted record.Watch for another PSoS post coming soon. Have a good week!
The Scarpetta Group, Inc.
FileMaker 13/12 Certified Developer & FBA Trainer
Follow us on Twitter: @scarpettagroup