You need to sign in to do that
Don't have an account?
forcewithu
For this, the externalURL is something like https://thevendor.urlhere.com. Of course, objectId is my Salesforce object and mySessionId is my Salesforce session so the vendor can connect to my webservice.
Open external URL in new window programmatically from Visualforce custom controller
In my custom controller for a Visualforce page, I'm dynamically building a URL to an external vendor site that looks something like this in my sandbox:
Code:
externalURL + '—id=' + objectId + '&sessionid=' + mySessionId + '&url=https://tapp0-api.salesforce.com/services/Soap/class/my_Web_Service'
For this, the externalURL is something like https://thevendor.urlhere.com. Of course, objectId is my Salesforce object and mySessionId is my Salesforce session so the vendor can connect to my webservice.
Once I build the URL, I want to open it in a new window (like target="_blank" for a hyperlink), leaving the original Visualforce page open in the Salesforce window.
I have the basic functionality working using a Redirect, but I've been unable to determine how to open it in a new window instead of overlaying the page in the existing one.
Attach that method to onclick attribute with the url.
All Answers
Here's the controller class code snippet.
Unfortunately, it's being called from an apex:commandButton which doesn't have a target attribute.
I thought I might be able to add it using apex:actionSupport, but it doesn't have a target attribute either....
Does the end user really care if it's a command button or a hyperlink? All they care is to get the right information at the right place.
If you don't want to use form and commandLink, you can use outputLink to do the same thing.
Attach that method to onclick attribute with the url.
Hi,
We have built an e-commerce application on force.com platform where visitors can purchase using their credit card.
We are sending a HTTP POST from the force.com platform to a location provided by a local banking web service, the endpoint is registered within the platform as required. The POST is successful, and we receive the proper response but it's not redirecting as it should. The response contains the form to be displayed, it contains a whole html with a credit card information form on it.
Several attempts to display the html in a new page have been successful but the form fails to function. Is there a way for the platform to redirect automatically after the POST, loading the document that it's receiving as a response in a new page with the the URL of the Banking Collector?
We have tried the JS option with the onclick to open in a new window, I am not sure if this is some security related issue from force.com platform or what. The page opens in a new page but it does not open the correct URL.
Please see the attached shots, fail.png is the issue we are having, good.jpeg is how it should be displayed.
Any help will be greatly appreciated.
This is how it should show up in a new window (notice the URL)
This is how it is failing (notice the URL)