Questions tagged [pagereference]

A PageReference is a reference to an instantiation of a page. Among other attributes, PageReferences consist of a URL and a set of query parameter names and values.

Filter by
Sorted by
Tagged with
13
votes
2answers
2k views

Fields missing using getContent call for Visualforce rendered as PDF

I am attempting to get the content of a visualforce page that is rendered as a PDF. I make some changes to the object that the visualforce page is displaying data from, update that object, make the ...
16
votes
1answer
7k views

pagereference return null vs void

I feel like I've noticed differences in the past between a pageReference returning null vs a void method. However, I can't recall now, does the pageReference returning null refresh the view state? Are ...
4
votes
1answer
5k views

Visualforce: Dynamically ReRender a row within <apex:repeat> by passing $Component through controller

I have a typical form with <apex:repeat> for some fields. The <apex:inputText> elements have an onChange attribute that references a script that then calls an <apex:actionFunction>, ...
7
votes
2answers
554 views

Bell icon in communities: syntax of the setTargetPageRef string?

The Winter '21 CustomNotification Class offers two ways to set the target navigated to when the message displayed under the "bell" icon is clicked: setTargetId(Id targetId) - Sets the ...
3
votes
1answer
2k views

Does <lightning:navigation> support targeting Visualforce pages with URL parameters?

I'm working on a Lightning component that includes a button, whose purpose is to load a Visualforce page rendering a PDF cover sheet. I'd like to use the most current supported functionality, so I'm ...
2
votes
2answers
4k views

How to test apex classes with Pagereference?

I'm struggling to test a class with pagereference. Following is the class... public with sharing class redirectOrderPartner{ public String currentRecordId {get;set;} public orders__c orderId {get;...
3
votes
1answer
2k views

The page you submitted was invalid for your session

EDIT: I have overridden the New button in Case object and opening a Visualforce page but if I open the page using preview VFP I'm not getting the error and its happening only when I click on NEW ...
2
votes
1answer
186 views

LWC URL reading parameters

I am trying to authorize another sandbox/production to create connection. When I first time authorize the connected app, it is returning the Auhorization Code in the URL, however when it gets ...
1
vote
2answers
279 views

Evaluation of approach to navigate between 3 LWC pages

Looking at building 3 screens and each has navigation between them using next, previous. Finish button to complete. I know that I could use Lighting Flows to navigate but I would not want to use it. I ...
10
votes
2answers
10k views

Best Practices : Page Reference method return null

I read about Page Reference, and the documentation states the usage of Page Reference: To view or set query string parameters and values for a page To navigate the user to a different page as the ...
6
votes
1answer
4k views

Redirect to standard view from VF page with nooverride parameter in SF1

The view of my custom object is overwritten by a Visualforce page for my desktop users. This VF page should not be visible for my mobile users. Before I render my VF page, I check the device to ...
5
votes
1answer
1k views

oAuth from VF Page in New Lightning - Cannot redirect vf page (iFrame) to login.salesforce.com

We have a visual force page that uses the Apex PageReference method to redirect the VF page to the https://login.salesforce.com for oAuth authentication. All is working well except in the new ...
4
votes
3answers
52k views

VF controller redirect to another page

I have a Apex Controller for a VF page. I want to redirect my page to another one, only if I cannot get a specific parameter from the URL. current page: /apex/demo?param=123 -> stay on this page. ...
5
votes
4answers
4k views

Provide standard clone button functionality to a button on vf page

I have an object whose standard new, edit and view button are overridden with a vf page.I want a Clone button on this vf page which should work exactly like standard clone button. If suppose i open an ...
3
votes
2answers
22k views

Displaying ApexPages.Messages on redirected VisualForce Page

I hope this is a simple problem and I'm just missing something. My Controller is something like this public pagereference processtempcon(){ //some code here delete record; pagereference ...
3
votes
1answer
5k views

The CORRECT way to redirect to a ListView from StandardSetController?

From a List Button or Visualforce Page, I wanna redirect to a ListView after. Common, right? Life is great when we're dealing with Standard Controller: using view() method. What is the correct, ...
1
vote
1answer
582 views

Salesforce knowledgebase sitemap.xml

Regarding this article I create dynamic sitemap for knowledgebase. I can't set my page name to sitemap.xml because of dot, only sitemap. And my sitemap available via link http://domain/sitemap ...
-1
votes
3answers
11k views

Test class for PageReference method

Hey I've written a controller for my VF page with a PageReference method. The pagereference is working fine but I'm having some issues with the test class. Controller class public with sharing class ...
7
votes
3answers
56k views

Using PageReference to redirect after new record insert

Continuing from my previous post. I want to redirect the user to a custom vf detail page when they create a new Service Order from my custom page order page (force_NewOrder). I have created a ...
4
votes
2answers
2k views

Making rest request with Oauth

I have all four Oauth token consumerKey, consumerSecret, accessKey and accessSecret. I need to make a request to a url from my apex code. Is there any library or a way to make this request. In java I ...
3
votes
2answers
5k views

How to pass {!Case.ID} to PageReference

I am having issues understanding how to pass the {!Case.Id} value to a PageReference in a visualforce class. My VF Page is: <apex:page standardController="Case" extensions="...
3
votes
0answers
595 views

Lightning experience embedded page redirect

I've got a VF page embedded into page layout. It redirects user to other VF pages (depending on user action) inside an iframe on page layout. In LE such PageReference redirects sort 'step out' from ...
1
vote
4answers
6k views

Redirect after a new record is save from Trigger

I want to redirect the user to a new page after a new record of a custom object CIP System is created from a Trigger. Is this possible? Here is the code I was using: trigger SaveRedirect on ...
0
votes
2answers
741 views

Test Method for Custom Controller which returns PageReference

I'm trying to define a test method to call a class constructor but somehow it doesn't work ///I create the test data, set Page Parameters etc Test.setCurrentPageReference(new PageReference('...
0
votes
1answer
276 views

call apex method from Form element

Is there a way to call Apex method to save the values in a form element? For example : <form id="scan-form" action="https://www.huika.com/payment/index.php/starting" method="post" ...
0
votes
2answers
151 views

Page Will not redirect

I have a commandbutton on a VF page that calls a method in the controller that should redirect to a new pagereference. When I select a value from a Selectcheckboxes control, the page will not redirect ...
0
votes
2answers
6k views

Id Value is not valid for standard controller

I am getting the error mentioned in subject with below code when execution runs through Else condition without DML statement. I am not getting how to change Pagereference? Apex Code AllocQ= ...
0
votes
2answers
677 views

PageReference redirecting to wrong url

I have a force.com site with custom url for my web2lead just say www.company.com/step1. i want redirect it to www.company.com/step2 after button clicked but it redirecting to www.company.com/step1/...
0
votes
1answer
325 views

Redirect to detail Page not working

Please find my below code where Redirecting to Detail Page is not working based on boolean value. Can someone please let me know the root cause? Apex Controller: public class CallReplica_controller {...
0
votes
3answers
4k views

open pdf in new tab

I have a generate pdf button which open the pdf and simultaneously store the same pdf as an attachment in Case object. But now i want is,pdf should open in new tab leave generate pdf button pafe as it ...