Stack Exchange Network

Stack Exchange network consists of 175 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
1answer
19 views

How to redirect to external url from apex from callout response

I have a class from which I do a callout in apex. After the response of the callout I want to redirect the user to an external url how can I achieve this?. I have only been able to redirect ...
0
votes
1answer
22 views

Salesforce Lightning component Create record type page click the next button Lightning page for operation [on hold]

I want to overwrite the new page. First, I set up the Lightning selection record type page, then click the next button to transfer the value to the next Lightning page for operation, just like the ...
0
votes
0answers
19 views

Need help writing a test class for this Apex class [duplicate]

I am very new to Apex and was able to write this class to clone a record. However, when I tried to deploy it to Production I only had 70% code coverage. I think my next step is to write a test class ...
0
votes
2answers
42 views

How to Redirect to /secur/logout.jsp from @Invocable method

I have a requirement where I want to logout of salesforce when certain statement inside an @invocable method is executed. For this purpose, I am trying to use PageReference to redirect to "/secur/...
0
votes
0answers
17 views

Dynamic redirection to Kanban listview

I'm trying to add on Account page layout, a quick action that will redirect to the Kanban listview showing related Opporutnities records to this Account only. Right now I'm trying to achieve this by ...
2
votes
1answer
52 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 ...
0
votes
1answer
41 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
0answers
26 views

Test class for pagereference in a method [duplicate]

I am unable to get code coverage for my pagreference, my code is code: public class selectedcase { public list<recordtype> record {get; set;} public id ids; public selectedcase(){ ...
0
votes
1answer
36 views

PageReference with Spinner

I have two-page references, on the first page I am performing a DML operation which takes time around 1,2 seconds, and then it goes to the next page. What I want is a loading symbol for those 2 ...
0
votes
3answers
42 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 ...
5
votes
1answer
131 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
47 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
25 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
82 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
57 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
174 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
15 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
115 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
56 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
219 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
61 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
124 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
44 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
114 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
368 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
234 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
38 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
867 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
25 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
58 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
65 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
59 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
51 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
27 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
123 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
1k 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
49 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
99 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
46 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
292 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
158 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
153 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
107 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
169 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
246 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
127 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
76 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
179 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
552 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 ...