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
0 answers
29 views

How to pass default value from Aura component to another component?

Community Pages : When user insert a record he should be redirected to another page which have many buttons (lightning:badge ) and only Button Support should be clicked by default , here's an example ...
user avatar
  • 3
0 votes
1 answer
131 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 ...
user avatar
  • 1
0 votes
0 answers
178 views

LWC detect page change event fired

I have a problem with my popup on Salesforce Community/Experience Page. I want it to close, when user change pages via navigation links, which are in other lwc components. I am currently using ...
user avatar
0 votes
0 answers
23 views

Unable to close or overide the component window with pagereference

Currently, I'm working on an aura component to convert a lead with the help of a Database.LeadConvert. After conversion, I'm navigating the user to the opportunity edit page. Now the problem is I'm ...
user avatar
  • 1,420
0 votes
1 answer
66 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({ ...
user avatar
  • 687
0 votes
1 answer
80 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("...
user avatar
  • 1,420
0 votes
0 answers
46 views

Unable to access PageReference/state within an Aura when clicking on QuickAction button

I have a simple quick action button which is opens a Lightning Aura component. I am trying to open a subtab when clicking on this button, but I am unable to access the PageReference to set the ...
user avatar
0 votes
0 answers
54 views

How should I designate CustomNotification's PageRef?

public void alertCompleteBatMes(Set<String> recipientsIds, String targetPageRef) { // Get the Id for our custom notification type CustomNotificationType notificationType = [...
user avatar
  • 31
0 votes
1 answer
32 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....
user avatar
  • 41
0 votes
1 answer
34 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 ...
user avatar
0 votes
0 answers
32 views

Navigate to a link with apex:command button

I have a <a></a> which downloads the document from salesforce(https://<salesforce_baseurl>/servlet/servlet.FileDownload?file='+ doc.Id). Below is the code for anchor tag. <a href=...
user avatar
0 votes
0 answers
39 views

Generating a CSV through a report inside an invocable method THROWS exception, but in a normal method it doesn't!

I am trying to generate a CSV through an InvocableMethod but it throws an exception. If the same code runs in a normal method, then no exception is thrown. In the following code for example sendEmail2 ...
user avatar
0 votes
0 answers
16 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 ...
user avatar
0 votes
0 answers
47 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 ...
user avatar
0 votes
1 answer
30 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....
user avatar
  • 15
1 vote
1 answer
26 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'...
user avatar
2 votes
0 answers
74 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(...
user avatar
2 votes
0 answers
318 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. ...
user avatar
  • 21
0 votes
1 answer
24 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 ...
user avatar
  • 11
1 vote
0 answers
373 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 ...
user avatar
0 votes
0 answers
188 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 ...
user avatar
1 vote
1 answer
31 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.*...
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 ...
user avatar
  • 451
0 votes
2 answers
255 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 ...
user avatar
0 votes
2 answers
251 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 ...
user avatar
  • 431
7 votes
2 answers
1k 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 ...
user avatar
  • 129k
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 ...
user avatar
  • 33
0 votes
1 answer
638 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/...
user avatar
1 vote
1 answer
158 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 ...
user avatar
6 votes
0 answers
771 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 ...
user avatar
  • 8,213
1 vote
0 answers
574 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. ...
user avatar
  • 29
0 votes
1 answer
1k 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 ...
user avatar
  • 303
0 votes
1 answer
38 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 ...
user avatar
0 votes
1 answer
73 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 ...
user avatar
2 votes
4 answers
2k 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 ...
user avatar
  • 1,420
0 votes
2 answers
188 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 ...
user avatar
  • 2,068
1 vote
2 answers
542 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 ...
user avatar
  • 4,521
0 votes
1 answer
40 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 ...
user avatar
  • 2,068
2 votes
1 answer
404 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 ...
user avatar
  • 1,393
1 vote
1 answer
4k 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://...
user avatar
1 vote
1 answer
27 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....
user avatar
  • 113
1 vote
1 answer
374 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 ...
user avatar
1 vote
0 answers
63 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). ...
user avatar
3 votes
1 answer
69 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)....
user avatar
0 votes
0 answers
87 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 :...
user avatar
7 votes
2 answers
1k 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 ...
user avatar
  • 393
3 votes
0 answers
2k 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 ...
user avatar
  • 617
2 votes
1 answer
3k 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 ...
user avatar
  • 1,439
1 vote
1 answer
3k 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 : ...
user avatar
0 votes
1 answer
104 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 ...
user avatar
  • 558

1
2 3 4 5 6