Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

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
1 vote
1 answer
29 views

How to wait for a VisualForce script to execute when calling it from an Apex method via PageReference?

I have an Apex controller MyController which calls a VisualForce page via PageReference. Here is my controller: public with sharing class MyController { @AuraEnabled public String param1 { get;...
ViqMontana's user avatar
1 vote
1 answer
126 views

VF page reference getContent() call returns HTML not PDF blob

I'm having an interesting problem trying to send an email to a Contact with a PDF attachment. I've got a VF page that renders as a PDF, and an page controller apex class that creates the email and ...
Lars's user avatar
  • 11
2 votes
0 answers
58 views

PageReference PDF preview does not display data

I'm trying to create a visualforce popup that displays a preview of a generated PDF (also using visualforce) with tables showing custom object data. The preview window displays the PDF with all the ...
Hyrum Schenk's user avatar
0 votes
1 answer
373 views

How to identify which region the LWC component is locating in App Page or Record Page?

I have an lwc component that is enable in App Page and Record Page. Whenever using this component, I want this component can identify which page is using it and which region on that page is it being ...
Tuấn Trần quốc's user avatar
0 votes
0 answers
143 views

How to open multiple instances using "standard__navItemPage" in a console app?

In salesforce we are using { type: 'standard__navItemPage', attributes: { apiName: 'MyCustomTabName' }, state: { c__recordTypeDeveloperName : 'TestRT', ...
Nagendra Singh's user avatar
0 votes
1 answer
277 views

Get PageReference from Page.variable

I am trying to dynamically set a PageReference based on a variable. String pageId = '0664A000000AAaA'; String pageName = [SELECT Name FROM ApexPage WHERE Id =: pageId ].Name; PageReference pdf = Page....
Joe Hayes's user avatar
  • 372
0 votes
1 answer
335 views

not able to fetch recordId from currentpagereference

I'm trying to get recordId from currentPageReference, I tried to get this from also like this - this.pageRef = this.currentPageReference(); this.recordId = this.pageRef.state.c__id; but it's ...
Abhishek Sharma's user avatar
0 votes
1 answer
211 views

onPageReference doesn't work

I have a custom lwc that navigates to an aura and it's working fine but whenever I change the url parameters the onPageReference method from the aura is not working. This is my lwc code: this[...
molinet's user avatar
  • 925
-1 votes
1 answer
339 views

Get the page from where the button is clicked

The New standard button in the Salesforce is overriden by the Lightning component (Aura). Now this New button is being used in the multiple places: While creating a contact record from the list view ...
Rahul Allada's user avatar
0 votes
1 answer
783 views

How to get the api name of the quick action which invoked the flow?

I am using a generic flow which can be invoked from multiple objects. In Flow, I have embedded the LWC Component, by using the Currentpagereference I am able to get the quick action name of the only ...
S1th's user avatar
  • 143
2 votes
0 answers
244 views

CurrentPageReference in Debug Flow context

It seems that a Wire call to CurrentPageReference does not work when the LWC is embedded in a Flow Screen when run in the context of Flow Debug mode. This works when the LWC is embedded in a page, and ...
Colin Steel's user avatar
0 votes
0 answers
77 views

Error on previously visited page

im having this kind of error. I want my page to redirect to the last valid page it goes to instead of Account-Show. For example, when I click on a product and I decide to Log-in, after successfully ...
exekiel vergara's user avatar
1 vote
1 answer
126 views

ApexPages.currentPage().getContent() returns different value when called from actionFunction than from commandButton

I have a visualforce page with the code below. I am calling a apex method on page load that gets the pages content to send in an email. The getContent function returns junk information if called ...
Robinson's user avatar
0 votes
0 answers
329 views

URL on List button not accessible through LWC

I need to override the 'New' button for a custom object on related list present on Opportunity. I'm navigating to a custom app page in which I have my LWC component. I need to pass the Opportunity ...
coder123's user avatar
  • 107
1 vote
0 answers
227 views

Apex - PageReference - Report URL

When our org was in classic, we had the below code which used to save a report as an Attachment. This has worked for the past 7 years... PageReference reportLink = new PageReference('/'+reportId+'?...
Neil Brown's user avatar
0 votes
1 answer
284 views

How to disable command button before the action?

Please help! I need that the button "Save" to be inactive before the user changes the Status in position. I tried to do this with disabled="{! If (Status==null, true, false)}". ...
Oleh Shepard's user avatar
0 votes
1 answer
4k views

Download a VF page as pdf with a button

I want to have a button that dowload a pdf page as a file related to the record from where I pressed the button. My page is working well, but I had to add a controller so clicking on the button ...
Alexis's user avatar
  • 129
1 vote
1 answer
399 views

trying to create a form in Visualforce page through custom controller, preview showing blank

while seeing preview its showing blank on salesforce classic also, custom controller class showing not found. <apex:page standardController="Timepagenew" > <apex:form> ...
Saurabh Kumar's user avatar
0 votes
1 answer
2k views

LWC initializing Modal/popup when Record Page loads

I created a LWC Modal/Popup component, a simple modal window to display some text. This modal window has OK and Close buttons. To test this modal/popoup I added a button to call it in the Record Page ...
Safaas's user avatar
  • 1
0 votes
1 answer
460 views

LWC - registerTestWireAdapter for lightning/navigation with imperative call from wired fails

Let's say we have @wire (CurrentPageReference) getStateParameters(pageRef) { if (pageRef) { /// some statements here this.setSomeData(); } } setSomeData() { getCardData({ ...
pincet's user avatar
  • 925
0 votes
1 answer
766 views

page reference is not navigating to edit page in lightning

I'm working on a lightning component under quick action. I'm trying to navigate the user to the edit page but it's navigating to the standard view page. var navService = component.find("...
Pavan tej's user avatar
  • 1,460
1 vote
1 answer
666 views

Static resource get files from zip

I want to give files from zip in static resource. How can i do it? It gives me 404 on getContent() anyway: with file ending(png,txt, etc) and without. PageReference pageRef = PageReference....
Terdivi's user avatar
  • 51
0 votes
1 answer
184 views

How to create a PageReference (url) to approval history?

I have a visualforce button that submits an approval request. I would like the method to return a PageReference that brings the user to the full Approval History related list. I can't seem to figure ...
Bo Laurent's user avatar
0 votes
0 answers
29 views

Construct Page Reference for a Survey Response Page

I am attempting to use a custom notification to send a survey reminder to a Salesforce user. I cannot figure out how to designate the page reference argument to the flow action that generates the ...
Dan Lambeth's user avatar
0 votes
0 answers
102 views

Page Reference and If Statement

I am looking to add another if/or statement that will also look for if the phone number is Anonymous to be redirected to the contact page. Here is what I have. It is working but I need to add ...
Earlene Jones's user avatar
0 votes
1 answer
412 views

Resetting page while displaying success message

I am trying to reset/refresh my page on my form. I want to refresh the page and then successfully display the success message however, it is only refreshing the page. The success message fails to load....
Sarah's user avatar
  • 15
1 vote
1 answer
333 views

NavigationMixin Page Reference throwing error

I've been at this for a few hours. I'm using JS directly from official Lightning documentation. I've added my custom LWC to Lightning Builder, and I'm getting the following error. In the JS below, I'...
Ryan McNeely's user avatar
2 votes
0 answers
477 views

pageReference.state.c__fieldValue is getting as undefined

In my Aura component, I am trying to access this URL value using below implementation: var pageReference = component.get("v.pageReference"); component.set('v.fieldObj',decodeURIComponent(...
Austin Evans's user avatar
4 votes
0 answers
1k views

Return Record Id of newly created Record After Using NavigationMixIn.Navigate

I have created a button in a custom LWC that when clicked, the below js runs. This opens the standard salesforce new record create modal and the user can then enter information to create a new record. ...
Tobi's user avatar
  • 41
0 votes
1 answer
65 views

How do I make my visualforce page rerender?

I'm using visualforce & apex classes to build a page where i'm outputting records from custom object. On the visualforce page I have a date field that on submission, will update the outputted ...
Shane's user avatar
  • 11
2 votes
0 answers
1k views

PageReference.state.inContextOfRef is returning undefined

I am on a record page and have an overridden 'New' standard action for a related list (child object). I am trying to get the record Id from the current page as the parent Id when I click 'New' from ...
user96887's user avatar
0 votes
0 answers
713 views

How to avoid hardcoding the URL in Apex class

I wrote this code looking at references and documentation. However, I want to prevent hardcoding of the URl . Also, the email that I receive goes to my company's junk mail box. What best practice can ...
GroundToCloud's user avatar
1 vote
1 answer
45 views

What difference does the __c make in currentPageReference in code?

What is the difference between keyword and c__keyword in the code below? What is happening below? this.searchKeyword = this.currentPageReference.state.keyword ? this.currentPageReference.state.*...
Gargi Gupta's user avatar
0 votes
0 answers
18 views

Can I send complex data when navigating via component.navigate()? [duplicate]

I have an order details lightning component page that makes an api call in the init action call to get all the order details (a giant 2k line json object). Once that page loads, there's an "Item ...
jbyrd's user avatar
  • 641
0 votes
2 answers
886 views

Can we redirect a user into a VF page from an Apex trigger

I have a scenario where a user if he/she uploads a file against a particular record, then the user will be redirected to a VF page after the file upload is successful. I wrote a simple trigger in ...
Rivu Indra's user avatar
0 votes
2 answers
454 views

open new record after finish flow

I created a visualforce page with an embedded flow. But If I click the "NEXT" button it appears the page https://domain.my.salesforce.com/Accountnull, but it should open the new account ...
peXeq's user avatar
  • 471
8 votes
2 answers
3k 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 ...
Keith C's user avatar
  • 136k
0 votes
0 answers
29 views

Test method issue for PageReference method [duplicate]

I am trying to to write a test method for my custom apex controller which contains a constructor and multiple PageReference methods, all returning null. I am trying something like this: @isTest Public ...
Badar's user avatar
  • 45
1 vote
1 answer
302 views

Authentication Vulnerability Issue with Page Redirect

We are using a third party company to scan our salesforce code for SOQL Injection and Vulnerability issues with open page redirects. The below code is flagged as a vulnerability. public Pagereference ...
Balaji Pooruli's user avatar
6 votes
0 answers
2k views

How to get a PageReference from Site.login(username, password, url) in an Apex Test

When I run this code from within a LWC controller: ApexPages.PageReference pageRef = Site.login(username, password, url); It returns a valid PageReference instance. But when I test the code in a ...
Robs's user avatar
  • 9,366
1 vote
0 answers
908 views

Upload file to google drive from Lightning component - Page redirect removing URL

I am trying to achieve functionality to upload a file from Salesforce to Google drive. I have done following 1. Google project credentials (Client key , secrete key) 2. Enabled Google drive API 3. ...
Amit's user avatar
  • 29
0 votes
1 answer
3k views

How to get pageReference on target Aura cmp init when being called from a different Aura cmp in a Community?

I've been stuck on this for a solid day now. I have a large package that need to deploy which uses 3 Aura components. They navigate to each other at various times using navigateToComponent. When I ...
paulK's user avatar
  • 323
0 votes
1 answer
67 views

Change ID of record being displayed on record page

When I am displaying a record page (such as https://myorg.lightning.force.com/lightning/r/Lead/00Q3i000004FudyEAC/view), how could my component on that page change the record being displayed? I know I ...
kamezaburo's user avatar
0 votes
1 answer
274 views

Redirect issue when input field empty on Visualforce page

I have created an Opportunity Wizard similar to this: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_wizard.htm Just practicing Visualforce pages. I run into an ...
sarthvader's user avatar
2 votes
4 answers
4k views

How to redirect to standard lead convert page in lightning

Currently, I'm working on lightning migration. So, I'm converting the javascript buttons to related quick actions & quick actions with the vf page respectively. I'm facing issues with the ...
Pavan tej's user avatar
  • 1,460
0 votes
2 answers
376 views

Why does controller gives: System.NullPointerException: Attempt to de-reference a null object

I have an apexclass with a pagereference for which I am writing a unittest but this returns an NullPointerException on controller.toCareerPageWithFilters(); what am i missing? public class ...
Thomas's user avatar
  • 2,298
1 vote
2 answers
1k 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 ...
SfdcBat's user avatar
  • 4,811
0 votes
1 answer
63 views

Unittest eror: System.NullPointerException: Attempt to de-reference a null object

I am writing a unittest for my apex class but get an error System.NullPointerException: Attempt to de-reference a null object on my unittest for variable: testoptions Apex class public class ...
Thomas's user avatar
  • 2,298
3 votes
1 answer
938 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 ...
Ajay 's user avatar
  • 1,589
1 vote
1 answer
8k views

Navigation and PageReference in Lightning Component - Why is url void?

UPDATE: I just verified it works when I navigate to my Lightning Component as part of a Lightning Page. My company is still in classic, so we're wrapping our components in Visualforce. https://...
Ryan McNeely's user avatar

1
2 3 4 5 6