You need to sign in to do that
Don't have an account?
dmcheng
Redirect after an HttpRequest POST?
In a Visualforce controller, if I need to do an HTTP POST to an external website and then redirect to that same URL, how do I do it?
Here's the situation: currently the client has a plain HTML form (standard HTML form and input tags) that submits search criteria fields directly to a 3rd party search web site. This appears in a new window and displays a list of results.
They want a custom button on the Salesforce account detail page to submit account fields as search criteria to the external website. It should still open a new window to show the results
Question is: once I send the HTTPRequest in the controller, how do I redirect to the external website? Do I set up a PageReference to the HttpResponse, or just to the original URL?
Here's the situation: currently the client has a plain HTML form (standard HTML form and input tags) that submits search criteria fields directly to a 3rd party search web site. This appears in a new window and displays a list of results.
They want a custom button on the Salesforce account detail page to submit account fields as search criteria to the external website. It should still open a new window to show the results
Question is: once I send the HTTPRequest in the controller, how do I redirect to the external website? Do I set up a PageReference to the HttpResponse, or just to the original URL?
I have assumed that the external website accepts url parameters link SFDC dees. You'd have to change that to appropriate format which the external site expects.
Hope this helps.
However I talked to a colleague and he suggested building a Visualforce page with an apex:form tag, set the input fields to the account merge fields, and use Javascript to submit the form to the external website, so I will try that.