Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
3answers
32 views

Load a visualforce page in apex controller

Is there a way to load a visual force page in apex controller without viewing the page. The scenario is this I have a visualforcepage with apex:chart embedded. This page will save the chart as an ...
2
votes
0answers
29 views

Spring19 release:Uncaught (in promise) TypeError

keep getting the following js error in my lightning component after the Salesforce Spring19 release: Can any one help please contextService.js:2 Uncaught (in promise) TypeError: Cannot read property '...
0
votes
1answer
27 views

How to close window automatically once the excel file got downloaded?

I have command button while clicking the button it will redirect to VF page where it will renderas data as excel also it will open a site.Once the excel download is completed,the window needs to be ...
0
votes
1answer
20 views

Page reference url is appending base url as well and not opening the page

so I have a page reference implemented in my apex page PageReference mypage=new PageReference('http://10:7:8...') which should ideally be opening in a new tab hitting the url mentioned on the click ...
1
vote
2answers
41 views

Redirect back to the VF page

In Classic: There is a New button on the VF page. On click of this button default new record create a page of the custom object gets open. On saving of the record, the page gets redirected to the VF ...
0
votes
1answer
40 views

How to redirect to another page in controller

I have developed one visualforce page and controller for account object and checking account.type is empty or not. If account.type is empty then page should be redirect to other page, this should be ...
0
votes
2answers
89 views

How to Redirect same page After clicking save button?

I have created visual force page for updating records from the page. . in my code Owner__c is Parent, Vehicle__c is Child. once i enter value owner object discount__c field , i need to update same ...
0
votes
1answer
14 views

Site.com visualforce page refresh

I want to refresh a site.com visualforce page on submission of a form, adding an additional query string parameter, but when I try and get the current page url it returns the /apex/controllerName ...
0
votes
0answers
68 views

Redirect using Pagereference in Apex in Lightning Experience on Visualforce page

We have a managed package in appexchange. When user install the app and goto Default tab of our app. We have Apex redirect (using PageReference with setRedirect to true). It works fine in Classic but ...
2
votes
1answer
37 views

Save PDF Visualforce as attachment - mergefields not showing

I really need your help because I'm completely stuck. I want to render a PDF from a Contract in Salesforce, and save it as a record's attachment. I followed several tutorials and I created a PDF ...
1
vote
1answer
92 views

PageReference.getURL() returning URL:[delegate:{MY RELATIVE URL}]

Im am trying to get the URL of one of my PageReferences whenever i call its method to return it to me i get this result URL:[delegate:{MY RELATIVE URL}]. Anyone know if why it's returning this, Please ...
1
vote
1answer
53 views

Keep focus on desired tab in Salesforce Application

I am having an application in which I have added one Tab in it also it has a default Home Tab. Now I need to open up another visualforce page on a button click. I have used PageReference here : ...
1
vote
1answer
67 views

PageReference setRedirect not working!

We are using lightning experience - servivce console. I am using following code to redirect the page flow to an error page for certain profiles. I can see in the debug logs that the PageReference is ...
1
vote
1answer
42 views

Apex Inputtext not getting assigned to variable in apex controller

I have below pageblocksectionitem in VF Page. <apex:pageBlockSection showHeader="false" columns="2" id="blockseciframe" > <apex:pageBlockSectionItem > <apex:...
0
votes
1answer
79 views

Static method cannot be referenced from a non static context (PageReference)

What is wrong here? Candidate__c cand = new Candidate__c(); insert cand; PageReference pageRef = Page.UploadCandidatePhotoVF; Test.startTest(); Test.setCurrentPage(pageRef); ...
1
vote
1answer
220 views

Why is the url parameter encoded?

Let's say I have a map object which will be converted into URL parameter. Map<String, Object> params = new Map<String, Object>{'accountId' => '0x10'} https://test.com/...
0
votes
0answers
185 views

Page Reference method opens in a new tab in lightning. How to stop it?

I am trying to implement google drive integration with salesforce, in which i am generating the authentication URL and send it to google to receive the access token. But while implementing that i came ...
1
vote
1answer
23 views

Populating multiselect picklist from page reference

I'm sending some parameters to custom controller of my object, which should be populated on multiselect picklist. In controller I'm creating a new Page Reference, where I put all parameters by using ...
4
votes
2answers
490 views

lightning:isUrlAddressable pageReference returns null

I'm trying to use the new lightning:isUrlAddressable interface to pass a few variables into a lightning component that is inside a lightning tab. In the init function I try to get the pageRefernce ...
1
vote
1answer
22 views

Call Excel VF Page from a static method in controller

I have a MS Excel VF Page that perfectly downloads data. Now in main VF Page I am having a remote action static method called using vf remoting from button on main page. From that method I need to ...
0
votes
1answer
45 views

how to cover pageRef.getParameters().put('id', MR.Id);

I know that so many questions like that. but no one answer is correct for me. How to cover below lines? (image below) Test public class TERF_Controller_CreateNew_TEST { static testMethod void ...
0
votes
2answers
45 views

PageReference .getParameters Method - Javascript Equivalent

Is there a javascript equivalent to the .getParameters method of the PageReference Class? Elaboration of what I'm trying to do: I am have a VFP search page and a CTI adapter. The CTI adpater pops ...
0
votes
1answer
45 views

How Does the Results of Page Reference GetContent Works?

I found this code somewhere else as I was trying to retrieve the API Usage from the System Overview. I'd like to grab some other details inside this page and I want to know the explanation behind this ...
1
vote
0answers
36 views

Logout from all tabs when from one tab a user logged out

I have a requirement like ,i have opened 2 3 tabs.And lets say i logged out from 1st tab.Then without refreshing my other tabs how will the user be redirected on to the login page. On tab 2nd there is ...
0
votes
0answers
22 views

Finish Location of a Visualforce-Embedded Flow Not Functioning as Expected

The screen flow in my VF page renders only after a couple of apex:selectList values are chosen: 'Report an Issue' --> 'One or More App Servers' --> Flow I want the flow's finish location to be the ...
1
vote
0answers
82 views

PageReference for quote/quoteTemplateDataViewer as PDF is blank

I'm having trouble getting a PDF when using a PageReference to the quoteTemplateDataViewer. This class is creating a QuoteDocument on the Quote record, but the contents of the document are blank. ...
0
votes
2answers
839 views

Pagereference not working in Lightning

I have a Detail page button (VF page) and controller for it. I used Pagereferenc method to take user to the record details page: However, it works fine in the Classic, but not in Lightning. ...
0
votes
0answers
35 views

Displaying to a Visualforce page inside an iframe

I've a problem displaying a VF page inside an iframe. In my app, the user can choose a Visualforce page that will be displayed inside an iframe (lets say inside a modal). My problem is generating the ...
1
vote
1answer
86 views

Save Redirects to blank page

When saving the visualforce page, it redirects to a blank page. Can anyone advise as to why it is not redirecting to the exact url for the current page cited in the PageRefrence at the bottom? When ...
1
vote
1answer
38 views

Unit Testing Apex code and can't set ID for pageref

I am trying to create a unit test for an Apex class that creates a series of records in other tables and then takes the user to one of the new records. This process all starts from a button on the ...
2
votes
1answer
245 views

Redirect visual flow to external URL

Good day Everyone I have created a flow which I embed inside visual force page. After the flow process, I want to redirect the page to external url like 'www.google.com'. The problem is that encounter ...
0
votes
1answer
139 views

Visualforce Page Redirect Weird Same-Origin

I have a pretty simple save action in my controller that redirects to record from pageReference but its returning an error Refused to display 'https://cs72.salesforce.com/0015D000009wrmEQAQ' in a ...
0
votes
1answer
139 views

Apex message present the message in new blank page

I have custom button which send email, I would like notify the user regarding if the action fail/success - but the message always present in new blank page. I wish the message to be presented in the ...
2
votes
1answer
96 views

Page Reference getContent method in a batch within a package

I'm struggling with the functionality of pageReference.getContent() inside my batch. When running the following batch in dev, works like a charm. When running it in a package, getContent returns an ...
4
votes
2answers
159 views

PageReference Parameters Overwritten Even With Different Case?

I ran into this issue and believe this is a Salesforce bug, and I am looking for confirmation. Maps are supposed to be key case sensitive but when we use the pageReference.getParameters.put() it does ...
3
votes
1answer
217 views

Ignore Duplicate Results Alerts for Visualforce Page

I have a [visualforce] page with a [standard controller] and a an [extension] that [queries] a child and grandchild of the standard controller. The grandchild records have a [duplicate] match rule. ...
0
votes
0answers
177 views

Content Type download in same Page in Visualforce Page

I have a Custom Lightning button. On button click I have written a Visual force Page to download the Record in an excel. I am able to successfully download the record but the page is getting ...
0
votes
0answers
105 views

Display in existing window with sidebar with PageReference puts page within page

I have a pretty simple Apex Controller + Action which I lifted from Salesforce Sidekick that takes a Flow, skins it up in Lightning Experience, and redirects to the newly created record. The issue I ...
0
votes
1answer
73 views

Apex:ActionRegion blocking Controller function Action

I'm trying to call a simple function in my Apex Controller and want to use an actionRegion to stop most sections of the page re-rendering. I note though when I add the actionRegion the controller ...
0
votes
2answers
1k views

How to test class called through a button with Visualforce

I Have this apex class which is called trough a button calling a visualforce page. How do I test my Pagereference in my testclass? I do not have coverage from // Code we will invoke on page load. ...
1
vote
1answer
151 views

Visualforce page does not update properly after Apex record delete operation

I have an embedded visualforce page on the Product2 page layout and an extension class for the Product2 standard controller that is used by this VF page. It's a little product photo management widget ...
0
votes
1answer
472 views

AddError not adding error on visual force page

I have a functionality, wherein I am using AddError via a trigger, the logic is fine and it is working perfectly in Insert but updating it is not working, I am getting the error message in my logs but ...
0
votes
2answers
58 views

Is redirect from a controller possible

I have a part of a visualforce page that redirects to a URL that works. I have another condition in my controller that is supposed to show an error condition if a certain condition is false. It only ...
1
vote
1answer
61 views

Visualforce wizard in Community

I tried apply VF Wizard( 1 Controller, 3 VF Page ) to Community but not work.. the Community is for guest user until C page work done, they don't have to login I applied... Guest user profile ...
0
votes
1answer
46 views

Calling Process.Plugin Class In Another Class

I have a custom VFP button that runs a parent flow, that runs a sub flow. The finishLocation of the flow is a page redirect to a custom object. I can't seem to pull over the value of the ...
0
votes
1answer
140 views

Code coverage page reference method [duplicate]

Hi am new to salesforce , how to do code coverage for this class - page reference method is written. below is the code: public with sharing class AttachmentController { public Attachment ...
0
votes
1answer
437 views

Save button in visualforce page not working

This is my visualforce page which displays the selected contacts from the previous page and a list of contacts in a picklist. <apex:form> <apex:pageBlock title="Selected contacts" > &...
0
votes
0answers
270 views

Return to same page after pagereference

I am having a VF page that generates content as excel, which I am calling from another page as a commandLink. The problem I am facing is when I click the commandLink, the current page becomes blank. ...
0
votes
1answer
722 views

How to write test class on Blob method

I have a PageReference method as given below I am trying to write a test class for this it shows error. Error Message: System.NullPointerException: Argument cannot be null. Stack Trace: ...
0
votes
1answer
220 views

Test a parameter from anonymous window

I am debugging code where it gets parameters from an opportunity record page but it seems to return empty. How can I test this in an anonymous window: productFamily = ApexPages.currentPage()....