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
0
votes
0answers
10 views

Inserting the values for selected field of the required object

I just want to insert the value for the selected field name of the selected object. I wrote the code but i am still little bit confused to write the code regarding the insert operation. please help me ...
0
votes
0answers
33 views

Return Null loses Parameters in Visualforce Page

I have a Savepoint set in apex controller. Inside the try block, I am having Pagereference set to redirect to newly created record id page. On Catch block, I simply want to put return null so that ...
0
votes
1answer
33 views

Test pagereference with selection of multiple Ids

I have a visualforce page where I select multiple ids. Based on my selection I start a flow. I dont know how to simulate the selection in my testclass. Visualforce <apex:page standardController="...
0
votes
2answers
64 views

How to get recordId for pageReference with Lightning

I am trying to navigate to an object's record page once it is created after a button click but the recordId is currently showing as undefined when I print it to the console. Any idea how to retrieve ...
0
votes
1answer
20 views

Is it possible to use lightning:navigation inside an aura:application?

What I need is a simple link to the org's home page. The documentation doesn't cover the case of aura:application but only cover the case of aura:component. If I copy-paste the example inside an aura:...
0
votes
0answers
21 views

PageReference redirect shows old data on refresh

I have a custom detail button on Contact that launches a VF page with an Apex class that updates data on the Contact record. At the end of the Apex class, I have a PageReference redirect, but when the ...
1
vote
1answer
36 views

Page Reference not redirecting

I am overriding the case select Record Type page. The page shud redirect to a custom VF page if selected record type is 'Support' else to the standard Case page VF Page : <apex:page ...
0
votes
1answer
43 views

Soql on Account returns empty Id

I have a controller where I get a token from a visualforce page with account as a standard controller and controller extension. In my unittest I insert the variables but the accid throws an exception ...
0
votes
1answer
26 views

How to test a page with parameters

I am writing a unittest for a pagereference where I add some variables I currently get only 47% coverage. How do I pass the variables correctly. I currently get the error: System.NullPointerException:...
4
votes
3answers
170 views

How to assert on pagereference where the endpoint of pagereference is predefined [duplicate]

I have a pagereference for which I want to write a test class but get the error Expected: System.PageReference[/CustomLoginPage], Actual: System.PageReference[/CustomLoginPage]. What am I doing wrong:...
0
votes
1answer
34 views

Passing parameter in URL in Lightning component and community pages

will it work in community pages, if yes then how, can you brief me? this is url and i am passing parameter in it as key= sunil https://deb1-coro.cs17.force.com/v2/s/invdetail?key=sunil var ...
0
votes
1answer
96 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
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
126 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
65 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
250 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
72 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
27 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
112 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
56 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
359 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
141 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
47 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
252 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
117 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
245 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
16 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
197 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
117 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
650 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
72 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
200 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
45 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
158 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
512 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/...
1
vote
1answer
54 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
2k 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
40 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
100 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
138 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
102 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
101 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
36 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
197 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. ...
3
votes
3answers
2k 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. ...
1
vote
1answer
163 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
57 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
388 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
177 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
183 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 ...