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

To Pass attributes used in Lightning component via e.force:navigateToURL

Am calling Target component (lightning page) from a source component var urlEvent = $A.get("e.force:navigateToURL"); urlEvent.setParams({ "url": "/lightning/n/...
0
votes
0answers
17 views

How to pass field value from one page to other in Salesforce Site

I created Force.com Site in salesforce, it has 2 pages. First page is used to save the contact record and second page will be used to upload any documents to newly created contact. Here problem is I ...
0
votes
0answers
24 views

Getting the URL parameter into Lightning component that implements flexipage

I have a component that is in a Lightning Page, I need to read parameters from the URL and handle their onchange. I found out that I can't use pageReference (always null) due to my component flexipage'...
1
vote
1answer
33 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 ...
6
votes
0answers
108 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 ...
1
vote
0answers
94 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. ...
0
votes
1answer
96 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 ...
0
votes
1answer
28 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 ...
0
votes
1answer
16 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 ...
1
vote
3answers
292 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 ...
0
votes
2answers
53 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 ...
1
vote
1answer
73 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 ...
0
votes
1answer
31 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 ...
1
vote
1answer
75 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
1answer
324 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://...
0
votes
0answers
54 views

Invalid Page Redirection

Good Morning, I have a problem with PageReference redirection to an inteneral visualforce page. When I press a JavaScript button it must call a flow and then redirect to an internal visualforce page. ...
1
vote
1answer
25 views

How to show different field value in a vf edit page

Right now I have a vf page that shows like this: <div class="col-md-5"> <input id="contactFirstName" type="text" class="form-control" name="userFirstName" maxlength=40 value="{!contact....
1
vote
1answer
112 views

Page Reference issue in Lightning

I have a command link button on Account page (Create Account). As soon as a user clicks on the button, an edit page gets populated to fill the details. Once the details are filled and hit the save ...
0
votes
0answers
62 views

lwc dependency injection with React/Vue app

I'm curious, if it's viable to inject something like @wire(CurrentPageReference) pageRef into a React app one is going to mount inside lightning web component. And yes, i am aware it is possible to ...
1
vote
0answers
31 views

How can I send an email while using PageReference getContent() method?

I am trying to send an email while using PageReference and the getContent() method which is, only ocassionally, throwing an error (seems like every couple of emails regardless of the frequency). ...
3
votes
1answer
42 views

salesforce Pre fill value in create page

Is it possible that pre fill value on the create page example: public PageReference Create() { Contact tmp = new Contact (); tmp.Name ='test123'; return new apexPages.StandardController(tmp)....
0
votes
0answers
76 views

@wire(CurrentPageReference) pageRef is not working in Salesforce mobile app

I am using @wire(CurrentPageReference) to get data passed from previous page. Here is my code: In first page navigating to second page like this: this[NavigationMixin.Navigate]({ type: "...
0
votes
0answers
27 views

Test Class for Page Reference Method Help [duplicate]

I'm not sure where to get started with writing this test class. I'm a junior developer and when trying to test createCourse PageReference method I get either an insert or assert fails, or I get an ...
0
votes
0answers
23 views

How to set subtab label of a component opened from another component using only PageReference and not workspace API

When i open a subtab from my main component, the label is loading... I only need to use pageReference type and as per the requirement, i cannot use worksapce API. Need help. My code: ViewCallHistory :...
6
votes
2answers
542 views

LWC Navigation (NavigationMixin) Bug. CurrentPageReference Becomes undefined and won't navigate?

I'm running into a bizarre bug that I can't track down. When using NavigationMixin.Navigate it works just fine MOST of the time. But occasionally, it just stops navigating. Digging into it as much ...
2
votes
0answers
396 views

Get check if a LWC is in a community

I am building a LWC that uses the pageReference that is not available in Communities. Is there a way to check what context you are in from the LWC, whether it's in a community, a record page, or ...
2
votes
1answer
2k views

NavigationMixin.Navigate not navigating to home on community - LWC

I am building a lightning community using LWC, where on successful login trying to navigate to standard home page of the community, but i see no URL redirection is happening.Below is the logic i have ...
1
vote
1answer
847 views

PageReference in AuraEnabled class is not working for Lightning Quick Action

I have a Quick Action using Lightning Component on Opportunity. Based on some scenario when a service return Case ID then through Page Reference I would like to return to Case Record Page. Code : ...
0
votes
1answer
36 views

Why does string.replace fail with char codes?

If have a login function that if there is a start URL I want it to go there other wise it should go to the default landing page. When I get the URL it substitutes special characters with char codes ...
1
vote
1answer
32 views

Accounts are not updating when I choose an account type from the dropdown box

I think I need a pageReference for the updateRecordList. Right now it runs but it won't display the accounts with the selected account type. Can anyone explain to me whats wrong? and how pageReference ...
0
votes
0answers
104 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
99 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
203 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
144 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:...
1
vote
1answer
39 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
52 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
30 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
249 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:...
1
vote
1answer
164 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
535 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
2answers
313 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/...
3
votes
1answer
1k 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
203 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
259 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
233 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
901 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
431 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
195 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
834 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 ...

1
2 3 4 5 6