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.

delete_contact-1024x589

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.

psos_delete_contact

So when we click the Trash icon we get this dialog.

psos_delete_dialog-1024x792

After clicking Yes we get the result of a deleted record.

psos_after_delete-1024x734

After clicking Yes we get the result of a deleted record.Watch for another PSoS post coming soon. Have a good week!

– James

James Scarpetta
The Scarpetta Group, Inc.
FileMaker 13/12 Certified Developer & FBA Trainer
james@scarpettagroup.com
Follow us on Twitter: @scarpettagroup

[info ]Like our blog posts? Sign up for our Mailing List on the bottom of this page! Have a “Time Saving Tip” of your own? Email info@scarpettagroup.com to share.[/info]