0

I have a real time integration between salesforce and MYSQL we get the response on HTTP call later we parse,map response and display it on the vf page. Now the end user updates some fields on these records and save changes to salesforce through the vf page. At this point on the save button I should be able to send these changes to a URL so that these changes can also be posted on mysql so that the entire org and multiple applications using the mysql db will be aware of these updates. How to push these changes to mysql without any call from them. What is the method that I have to use in my Integration class?

Thanks

2
  • Do you have existing web services that populate data into MYSQL, or are you going to be creating them from scratch for this integration? Commented Jul 13, 2015 at 21:33
  • I already had a webservice or HTTP link where I make the calls Commented Jul 13, 2015 at 21:49

1 Answer 1

1

There are a number of options to make a callout from Salesforce to your existing web service.

Using a workflow rule and outbound message is one option, but would be more difficult with an existing web service.

Instead, you could create a trigger on the records of interest. The Trigger would call a future methods with the Id's of the records that need to be sent to the external web service. Finally, the future method would make the actual callout to the web service.

It you need a more resilient solution consider maintaining a queue object and have a scheduled batch job make the callouts and handle any subsequent problems.

What is the methods(Get,Post) that I have to use in making these callouts to send these Ids to the external webservice

It isn't clear what the requirements for your web service are. However, one option to invoke it would be to use the HttpRequest class. This includes a setMethod method so you can specify GET/POST.

I need to send these changes to the external webservice whenever there is an update on object with a particular [field]

As I mentioned above, you can use a trigger on update to examine the records being changed. Part of this process allows you to access both the old and new values of the record. Once you have built up a Set or affected Ids you can pass it off to the future method that will call the web service.

3
  • Thanks Daniel, What is the methods(Get,Post) that I have to use in making these callouts to send these Ids to the external webservice. Commented Jul 14, 2015 at 14:11
  • Also I need to send these changes to the external webservice whenever there is an update on object with a particular filed. Commented Jul 14, 2015 at 17:00
  • @HarishGudipudi, extended answers inlined. Commented Jul 14, 2015 at 22:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .