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
F.H.KazmiF.H.Kazmi 

Call a URL when a database trigger executes

I need to create a database trigger will be configured for new lead record or update lead record is such a manner that when ever any  lead record will be inserted or updated, it will call a URL i.e. post some data to a URL. 

 

In other words I need to know how can I post any data (either through GET or POST) or call any URL when a database trigger executes. Can it be done and how??

micwamicwa

You can call a Webservice (must have @future annotation) from your trigger and use the HttpRequest Class to either create a GET or a POST request.

 

You can find more information in the "Apex Language Reference" on page 266.