function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KJesseKJesse 

Salesforce Account Delete makes SQL delete a specific entry

What is the best way to trigger a SQL database delete from a salesforce account removal?
Best Answer chosen by KJesse
Andy BoettcherAndy Boettcher
If you have a web service setup on a remote server (SQL-end) you could leverage the delete trigger to make a callout to that service with the deleted record's information.

All Answers

Andy BoettcherAndy Boettcher
If you have a web service setup on a remote server (SQL-end) you could leverage the delete trigger to make a callout to that service with the deleted record's information.
This was selected as the best answer
KJesseKJesse
Hi Andy,

I think I would want to make an HTTP callout from an apex trigger /class to a web server php script which could perform the operations necessary. Does this sound correct?

If this is the right approach how should I authenticate this HTTP callout from salesforce in my web server? It is crucial to make sure that the php script is only accessible from salesforce
Andy BoettcherAndy Boettcher
You're correct!

You can either setup basic authentication on your web server and configure the callout to pass the authentication information - or you can lock down the IPs that your web server responds to by the list of datacenter IPs that Salesforce maintains.