Question

Salesforce integration with External system using the HTTP POST method

Asked by: sumprit

Hi there,

How can I send the data from Sales force to an external system?

I believe it can be done through a S-Control which can be attached to the custom button (URL type) that will trigger to send the data using HTTP POST method.

Has anyone ever done anything like this and could you share the details with me.?

Thanks

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2007-11-21 at 09:10:16ID22975953
Tags

salesforce

,

http

,

integration

,

Salesforce.com

Topic

CRM Software

Participating Experts
2
Points
500
Comments
26

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Trigger an external program?
    I am trying to develope a database system that when an entry is being inserted into a table, an external program (C++ or VB, to manipulate data) will be run with some database's data as parameters. And then the external program will return some results which will be stored in...
  2. triggers
    hi every1.. i m making a project in oracle.. the project is for a company which sells and buys products so there is a stock table a purchase table and a sales table.. what i want 2 do is that when some1 inserts data in the sales table and requried stock is not available then...
  3. Hide - External application
    In my VB Program I call an external dos application in HIDDEN mode. The problem is, that dos application triggers msgbox/alert which pops up in the screen!!! I dont want this msgbox to show up. Let it show, but in hidden mode. I'm not interested in pressing "OK" for...
  4. Tracking sales
    how can sales be tracked in asp? for example when a customer lands in: www.test.com/default.asp?referer=google And the payment page is payment.asp How can you track if it was a sale coming from a google referal? Tks.

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: sumpritPosted on 2007-11-26 at 09:12:42ID: 20351273

hi guys,

please respond , I am desperately looking for some answers here.

thanks

 

by: techhealthPosted on 2007-11-30 at 13:25:31ID: 20385417

S-control is the hardest route to go.  :-)  Can you tell me a bit more about the task on hand?  SF has other easier ways for specific integration tasks.

 

by: sumpritPosted on 2007-11-30 at 14:57:55ID: 20385959

So based on the requirements I have here are the details:-

1.> From Salesforce, under Opportunity user clicks on the Fulfillment custom button which will send out the details to an external system.

This custom button will capture the field details from the Opportunity and Account object. The following fields will have to be captured from the Opportunity object:-
      a) Opportunity ID
      b) Opportunity Owner
      c) Owner ID
The following fields will be captured from the Account object :-
      a) Account Name
      b) Account ID
      c) Billing Address
      d) Phone
      e) Fax
      f) Website
These details will be sent out to the external system called - BPM, using the HTTP POST method which can be accomplished through the S-Control embedded in a custom button.


 

by: sumpritPosted on 2007-11-30 at 15:23:13ID: 20386077

the SOQL Query for the above is following:-

Select o.AccountId, o.Account.BillingCity, o.Account.BillingCountry, o.Account.BillingPostalCode, o.Account.BillingState, o.Account.BillingStreet, o.Account.Fax, o.Account.Id, o.Account.Name, o.Account.Phone, o.Account.Website, o.Id, o.Name, o.OwnerId, o.Owner.Name from Opportunity o where o.Id = '{!MERGE FIELD}

 
NOTE:-
-------
How the CRITERIA is designed, where Opportunity.ID = Opportunity.AccountID


 

by: techhealthPosted on 2007-11-30 at 17:52:33ID: 20386619

OK.  That does sound like something that requires a fair amount of manual coding...  So your BPM takes simple POST parameters instead of Web services calls?  That may or may not be a good thing.

 

by: techhealthPosted on 2007-11-30 at 19:16:32ID: 20386817

SF can do an outbound SOAP message via workflow triggers, which is much easier to set up than custom S-Control actions.

 

by: sumpritPosted on 2007-12-02 at 15:55:56ID: 20392907

so what do you suggest is best approach to do this.

any example? any starting point to do this?

 

by: techhealthPosted on 2007-12-03 at 05:58:35ID: 20395356

Well, my question really is, how your BPM take in information?  Is it good old way like http://bpmsystem.com/input.cgi?para1=company&para2=name, or does it work like a Web services endpoint that takes a SOAP message for input?

 

by: Bill-HansonPosted on 2007-12-03 at 07:39:00ID: 20396060

The easiest way is to pass minimal info to your remote server via URL parameters.

(1) Create a simple link that includes as parameters, the OpportunityId, the current SessionId, and the ServerUrl.
(2) In your server side code, use the Web Services API to validate the SessionId against the ServerURL, then do whatever you need to the Opportunity.

 

by: sumpritPosted on 2007-12-03 at 10:53:17ID: 20397553

Thanks Guys!

I still have not received all the user requirements regarding this project. From the verbal discussion it seems, that a custom button will be placed on Oppurtunity tab and from there when the user clicks on this button, the field values will be sent over to the BPM System. I have not received the URL yet or on how this information will be received at the other end. I will find out by the end of the day.


 

by: sumpritPosted on 2007-12-03 at 10:57:14ID: 20397590

As a starting point, I wrote this S-Control:-
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

<html>
<head>
<script src="/soap/ajax/9.0/connection.js" type="text/javascript"></script>

<script>
function setupPage() {
//function contains all code to execute after page is rendered

var state = { //state that you need when the callback is called
output : document.getElementById("output"),
startTime : new Date().getTime()};

var callback = {
//call layoutResult if the request is successful
onSuccess: layoutResults,

//call queryFailed if the api request fails
onFailure: queryFailed,
source: state};

alert("start");

sforce.connection.query(
"Select o.AccountId, o.Name,o.ID from Opportunity o WHERE o.id='{Opportunity.AccountID}' ",callback);

alert("end query");

}

function queryFailed(error, source)
{
alert("QueryFailed...");
source.output.innerHTML = "An error has occurred - query: " + error;
}

/**
* This method will be called when the toolkit receives a successful
* response from the server.
* @queryResult - result that server returned
* @source - state passed into the query method call.
*/
function layoutResults(queryResult, source)
{
var output = "";

if (queryResult.size > 0)
{
//get the records array
var records = queryResult.getArray('records');

//loop through the records and construct html string
for (var i = 0; i < records.length; i++)
{
var Opportunity= records[i];
output += Opportunity.AccountId + " " + Opportunity.Name + " " + Opportunity.ID + " <br>";
}

}

// output += "ID - Status<br>";
//render the generated html string
source.output.innerHTML = output;
}
</script>
</head>

<body onload="setupPage()">
<div id="output"> </div>
</body>
</html>

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


Here is what is happeneing here:-


1.> This S-Control is placed on the custom button called "Start the BPM" which is on Oppurtunity tab.
2.> Notice the SOQL Query, which is capturing the data from the fields.
3.> It will display the data in a seperate window.

4.> This is a starting point, and as I get more details this code will be edited.



 

by: Bill-HansonPosted on 2007-12-03 at 11:13:50ID: 20397723

This will get the data you need, but since you're just passing the data to another system, there is a much faster way.  Since you are just passing data from the current record, you don't need an sControl at all.  No SOQL either.  All you really need is a custom link that uses merge fields.

For example, to pass all of the fields you listed above to some external system, you can just create a URL to the external system like this:

https://your_server/your_agent?id={!Opportunity.Id}&aid={!Opportunity.AccountId}&oname={!Opportunity.Name}

Then the code on the receiving end can just extract the values from the query string.

 

by: techhealthPosted on 2007-12-03 at 12:10:11ID: 20398171

That's why I asked what your BPM takes as input.

>>All you really need is a custom link that uses merge fields.

That'll work fine if your BPM doesn't expect a Web Service call.

You'll still need some querying though, if you need more than just info from the current object in context, i.e., combining info from multiple objects.

 

by: sumpritPosted on 2007-12-03 at 12:13:10ID: 20398197

Thanks Bill.

let me try this now...and I will let u know in a short while.

thanks

 

by: sumpritPosted on 2007-12-03 at 13:14:06ID: 20398753

Hi again,

I have a question regarding this statement?


\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Is BPM system expecting a Web service call?
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

We have decided on simple HTTP POST method? Is this not a good thing? What am I missing here?

 

 

by: techhealthPosted on 2007-12-03 at 13:32:29ID: 20398913

It's easier to implement in some cases (like Bill suggested), but it's a less flexible and scalable way to do it.  Don't worry too much about it.  You'll be fine either way.

 

by: sumpritPosted on 2007-12-03 at 14:26:49ID: 20399372

Thanks techhealth.

Bill,

About what you mentioned earlier :-
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
For example, to pass all of the fields you listed above to some external system, you can just create a URL to the external system like this:

https://your_server/your_agent?id={!Opportunity.Id}&aid={!Opportunity.AccountId}&oname={!Opportunity.Name}

Then the code on the receiving end can just extract the values from the query string.
/////////////////////////////////////////////////////////////////////

Since, I do not have the URL address at this moment, can I still try out this option. Later, when I get the URL address I will edit it. This will help me understand it more better.

I am thinking like this:-

1.> Create a custom button, with Display Type = List Button
2.> Content Source = URL
3.> In the Body section, what should I mention?


 

by: sumpritPosted on 2007-12-03 at 16:29:23ID: 20400073

I have found the answers to your questions:-

Answers to you questions to the best of my knowledge:

 

1.> BPM isnt taking, we are sending the information. So we need to use HTTP POST message only.

The key is, to get it into an HTTP POST message.

I guess you need to figure out how to make an HTTP POST message and then get Salesforce to put the correct data into that message to be sent to whatever address BPM wants us to send it to.

This is my requirement. and that is the reason why I created that S-Control. This S-control for now is only displaying data in a seperate window, later on when I get that BPM address I will edit it accordingly.

My question again is:-
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

How will I send the data from Salesforce to BPM system using the HTTP Post method?


thanks

 

by: sumpritPosted on 2007-12-06 at 12:39:31ID: 20423069

looks like this problem is solved. Here is what I found from one of the research over the Apex Wiki network.

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

You can do this using Salesforce SOA, in an S-Control, button, or link. If you have Unlimited Edition, you can also create calls using Http, HttpObject, and HttpResponse from the Apex Code object library. If you have the AJAX version, simply call the function in a place convenient for you. In Apex Code, you can't (unfortunately) use triggers, so you have to use a webservices method or use Apex AJAX to invoke the code via the Salesforce API through the browser. For example:

Code: {!RequireScript("/soap/ajax/11.1/connection.js"} postParams = {} postParams.url = 'http://www.mydomain.com/services/function' postParams.method = 'POST' postParams.requestData = 'data to send' // place your data here postParams.requestHeaders = {} postParams.requestHeaders['Content-Type'] = 'text/plain' //or another mime-type postParams.requestHeaders['Content-Length'] = postParams.requestData.length //required for POST postParams.onSuccess = processSuccess postParams.onError = processError sforce.connection.remoteFunction(postParams) function processSuccess(message) { // do something with results } function processError(message) { // do something with the error }
 You can use that in a button or link on the object, or you can replace the first line with a normal script include for an S-Control. I do hope you find this useful.
/////////////////////////////////////////////////////////////


Thank you so much.


Please check again, I will be posting more Sales force related queries.


regards to all.

 

by: techhealthPosted on 2007-12-06 at 13:23:45ID: 20423409

Salesforce SOA is certainly the way to go for SOAP based BPM endpoint.  But Bill's method is still way easier if your URL is a simple query string format.

 

by: sumpritPosted on 2007-12-06 at 14:25:49ID: 20423979

Hi again,,


I did discuss Bills solution, which was:-

For example, to pass all of the fields you listed above to some external system, you can just create a URL to the external system like this:

https://your_server/your_agent?id={!Opportunity.Id}&aid={!Opportunity.AccountId}&oname={!Opportunity.Name}

Then the code on the receiving end can just extract the values from the query string.

    * Accept Multiple Solutions
    * Accept as Solution

===================================================================
===================================================================


1.> The problem is that I do not have any URL related information of the external system.

2.> Bill, is suggesting to write a code at the receiving end, however in real world I will not be able to access the external system.

3.> We just want to send data from Salesforce to the External system in a simple format. We dont care what is happening at the receiving end.

4.> This is the reason, HTTP POST method inside the S-control would be a best option.

If you still think otherwise, please let me know I am open to suggestions and thoughts.

Kind regards

 

by: techhealthPosted on 2007-12-07 at 07:52:14ID: 20428259

I guess you'll HAVE TO know a bit more about your receiving end.  If you're talking to a dog, speak cat is not gonna help. :)  You said "sending data to the external system in a simple format".  And what is that simple format?  Does your external system expect plain text parameters? Or does it expect SOAP messages?  The answer will decide what your put in your requestData, Content-Type, and so forth.

And if the remote system only needs plain parameters, then why bother with remoteFunction()?  A custom URL with merge fields will work fine.

Bill is not suggesting YOU writing the code at the receiving end.  He's just saying you need to know HOW the receiving end is going to consume your data, so you can tailor your output.  Tossing a lettuce to a hungry tiger won't be a proper feed for the beast.  :)

 

by: sumpritPosted on 2007-12-07 at 08:47:17ID: 20428805

I need some time to give this a thought. It makes so much sense, but I need to find out a way to put this together and present this to the management.

I will post my reply again by weekend.

thanks

 

by: sumpritPosted on 2007-12-10 at 14:17:29ID: 20445799

Can you please put a hold on this question.

I am still reviewing the suggestions provided by other experts, and that maybe the better option. I am not sure.

thanks

 

by: sumpritPosted on 2007-12-11 at 15:59:33ID: 20454098

I would like to split points between - techhealth and Bill-hanson. they both make sense and I need to do more research on my part about this question.

Thanks guys.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...