3

I wish to redirect the user to this page with the relevant parameters. How does one do this?

<apex:page>
<apex:iframe src="PageReference page = new PageReference('https://forms55.com/88/?ContactID18='+ContactID18+'&AppID18='+AppID18+'&ProgramID18='+ProgramID+'&semName1='+semName1+'&semName2='+semName2+'&semName3='+semName3);" scrolling="true" id="theIframe"/>
</apex:page>
  • Why do you need an iframe to redirect a user to a page? – Ruslan Vekua Apr 11 '16 at 12:05
  • That allows us to keep the look and feel. No other reason. – Apex N-u-b Apr 11 '16 at 12:08
  • How about if you remove pageReference object and pass parameters as below? <apex:iframe src="forms55.com/88/?ContactID18={ContactID18}&AppID18={AppID18}&ProgramID18={ProgramID}&semName1={semName1}&semName2={semName2}&semName3={semName3}" scrolling="true" id="theIframe"/> – Ruslan Vekua Apr 11 '16 at 12:13
  • I tried what you suggest but the parameters do not seem to be passed. The same page works fine when passing the parameters in a regular GET method and not within a iframe. – Apex N-u-b Apr 11 '16 at 12:52
  • Can you share your controller? – Ruslan Vekua Apr 11 '16 at 12:54
2

I don't understand even why you need the iframe there but here is the right usage of the apex iframe:

Your iframe should be like below:

<apex:iframe src="https://forms55.com/88/?ContactID18={ContactID18}&AppID18={AppID18}&ProgramID18={ProgramID}&semName1={semName1}&semName2={semName2}&semName3={semName3}" scrolling="true" id="theIframe"/>

The parameters should come from a controller/extension.

Please take a look at the apex iframe for more detail.

Also, there an example of Defining Getter Methods. You need it to display your parameters' value on VF page.

  • I wish to embed a form from another website of ours that has nothing to do with salesforce. How to embed it without an iframe and have it display with the look and feel of SF which is where it originates? If you have a better way please share. – Apex N-u-b Apr 11 '16 at 12:34
  • Yes, you can use iframe, connected app or JavaScript/JQuery. – Ruslan Vekua Apr 11 '16 at 12:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.