Skip to main content
Bumped by Community user
deleted 83 characters in body; edited tags
Source Link
Adrian Larson
  • 151.3k
  • 38
  • 247
  • 431

I have a Visualforce page that's a form which is linked to my custom object in Salesforce.

However, I want the form to be saved and then redirect the user to my second Visualforce page (Thank You Page) without using an apex extension page.

I was told I can use JavaScript to do so however the code that I have written is not working as expected.

<apex:actionFunction name="saverecordandredirect" action="{!save}" oncomplete="location.href = '{! $Page.ThankYouPage }'" />

<apex:commandButton value="Save it" onclick="saveandredirtect() ;"/>

So please if anyone knows how I can achieve this, please let me know, thanks!

I have a Visualforce page that's a form which is linked to my custom object in Salesforce.

However, I want the form to be saved and then redirect the user to my second Visualforce page (Thank You Page) without using an apex extension page.

I was told I can use JavaScript to do so however the code that I have written is not working as expected.

<apex:actionFunction name="saverecordandredirect" action="{!save}" oncomplete="location.href = '{! $Page.ThankYouPage }'" />

<apex:commandButton value="Save it" onclick="saveandredirtect() ;"/>

So please if anyone knows how I can achieve this, please let me know, thanks!

I have a Visualforce page that's a form which is linked to my custom object in Salesforce.

However, I want the form to be saved and then redirect the user to my second Visualforce page (Thank You Page) without using an apex extension page.

I was told I can use JavaScript to do so however the code that I have written is not working as expected.

<apex:actionFunction name="saverecordandredirect" action="{!save}" oncomplete="location.href = '{! $Page.ThankYouPage }'" />

<apex:commandButton value="Save it" onclick="saveandredirtect() ;"/>

Added the code to the text so people can have a better understanding for what I am trying to do.
Source Link
Ola
  • 11
  • 3

I have a Visualforce page that's a form which is linked to my custom object in Salesforce.

However, I want the form to be saved and then redirectedredirect the user to my second Visualforce page (Thank You Page) without me using an apex extension page.

I was told I can use JavaScript to do so however the code that I have written is not working as expected.

This is the code that I've got so far:

<apex:actionFunction name="saverecordandredirect" action="{!save}" oncomplete="location.href = '{! $Page.ThankYouPage }'" />

<apex:actionFunction name="saverecordandredirect" action="{!save}" oncomplete="location.href = '{! $Page.ThankYouPage }'" /> <apex:commandButton value="Save it" onclick="saveandredirtect() ;"/>

So please if anyone knows how I can achieve this, please let me know, thanks!

I have a Visualforce page that's a form which is linked to my custom object in Salesforce.

However, I want the form to be saved and then redirected the user to my second Visualforce page (Thank You Page) without me using an apex extension page.

I was told I can use JavaScript to do so however the code that I have written is not working as expected.

This is the code that I've got so far:

<apex:actionFunction name="saverecordandredirect" action="{!save}" oncomplete="location.href = '{! $Page.ThankYouPage }'" /> <apex:commandButton value="Save it" onclick="saveandredirtect() ;"/>

So please if anyone knows how I can achieve this, please let me know!

I have a Visualforce page that's a form which is linked to my custom object in Salesforce.

However, I want the form to be saved and then redirect the user to my second Visualforce page (Thank You Page) without using an apex extension page.

I was told I can use JavaScript to do so however the code that I have written is not working as expected.

<apex:actionFunction name="saverecordandredirect" action="{!save}" oncomplete="location.href = '{! $Page.ThankYouPage }'" />

<apex:commandButton value="Save it" onclick="saveandredirtect() ;"/>

So please if anyone knows how I can achieve this, please let me know, thanks!

Post Undeleted by Ola
Post Deleted by Ola
Source Link
Ola
  • 11
  • 3

How to use JavaScript to save Visualforce form and redirect to Thank you page

I have a Visualforce page that's a form which is linked to my custom object in Salesforce.

However, I want the form to be saved and then redirected the user to my second Visualforce page (Thank You Page) without me using an apex extension page.

I was told I can use JavaScript to do so however the code that I have written is not working as expected.

This is the code that I've got so far:

<apex:actionFunction name="saverecordandredirect" action="{!save}" oncomplete="location.href = '{! $Page.ThankYouPage }'" /> <apex:commandButton value="Save it" onclick="saveandredirtect() ;"/>

So please if anyone knows how I can achieve this, please let me know!