+ Start a Discussion
Cloud AtlasCloud Atlas 

Sending Records to API on Create/Update

Team,

I am looking for some info into sending records to an external API everytime an Account is created or updated.
It will not be a Batch Job, but instead a callout everytime account information changes.
Is it possible to do it from the salesforce layout itself,  without having to write a custom VF page for triggering the callout ?
( The reason I mentioned VF page route, because that is what I know).
I have already gone through the developer guide , so please don't reference that.
I am not looking for code , but the framework/algorithm to do it.

Any help will be appreicated.
Thanks!
 
Best Answer chosen by Cloud Atlas
Ashish KeshariAshish Keshari
Hi Cloud - I would say please create a ProcessBuilder which will execute for each Account being created or edited. From the process builder you can invoke an Apex method which will run in future using @future(callout=true) and can make webservices call. You can read my blog here - www.ashishkeshari.com - read the section "Synchronize Outbound Project Data" where I am invoking an Apex method from a process builder and making web services call in future. Hope this helps.

All Answers

Ashish KeshariAshish Keshari
Hi Cloud - I would say please create a ProcessBuilder which will execute for each Account being created or edited. From the process builder you can invoke an Apex method which will run in future using @future(callout=true) and can make webservices call. You can read my blog here - www.ashishkeshari.com - read the section "Synchronize Outbound Project Data" where I am invoking an Apex method from a process builder and making web services call in future. Hope this helps.
This was selected as the best answer
Cloud AtlasCloud Atlas
Hey Ashish,

Thanks for your response.
First of all, let me just say that your website is wonderful.
The details are absolutely brilliant.

I checked "Synchronize Outbound Project Data" and it is right up what I was loooking for.
I do have few questions for you .... why are you using both Remote Setting and Named Credentials and on top of that you are storing username/pass/token in Custom Setting.
Plus, I imagine that you are created Connected app to capture the response back from external system, correct ??
Also, where are you passing username and password info??

Maybe I missed something so let me know, where I am mistaken, when you can.
Thanks!
 
Cloud AtlasCloud Atlas
Never mind...
I figured it out.
Thanks for all your help Ash.
Cheers!