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
3
votes
2answers
687 views

Visualforce Page Reference : Managed Package

As I understand, I can refer one VF page from another VF page using page reference. However, if out of these two VF pages, one VF page is a part of the Managed Installed Package, is it possible to ...
3
votes
1answer
944 views

Displaying messages on redirected VF page

This is roughly the same question as in here, I can't comment so I'm re-asking. My problem is that if the redirect is created in the method assigned to apex:page action attribute, the messages are ...
3
votes
0answers
971 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 ...
3
votes
1answer
837 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 ...
3
votes
0answers
596 views

Lightning experience embedded page redirect

I've got a VF page embedded into page layout. It redirects user to other VF pages (depending on user action) inside an iframe on page layout. In LE such PageReference redirects sort 'step out' from ...
3
votes
0answers
2k views

Lightning Experience gets 'stripped' when redirecting from Visualforce page

I`m struggling to fix an issue which arise with the new Salesforce Lightning Experience. So, I have a Visualforce page which is assigned to the Edit functionality of Accounts. In Salesforce Classic ...
2
votes
2answers
13k views

New Tab for PageReference

I want to open my Vf page on new tab please guide me what i need to do to get the process done my code : public PageReference totalbookedClick(){ date myDate = date.today(); integer ...
2
votes
3answers
3k views

Returning PageReferences from Init - Not working in sandbox

So either I'm going nuts, or I'm overlooking something obvious, or I'm just encountering some very weird behaviour. The Setup I have a page which calls an Init action in the controller from the page ...
2
votes
1answer
197 views

Why does this PageReference take me to the wrong page?

Given a "save" method such as this: public PageReference save() { try { insert current_search; } catch(System.DMLException e) { ApexPages.addMessages(e); return null;...
2
votes
1answer
1k views

Why does my returned PageReference not work

I created two apex pages to test clicking a button to change pages and it works fine. but my cancel button just refreshes the page. can anyone please explain why this isn't working or what I need to ...
2
votes
2answers
1k views

Values don't update after I call action on a commandbutton?

I am trying to implement functionality in SalesForce where when a user clicks a button then the following count increases. Currently I have a simple test page that just shows the following count. ...
2
votes
2answers
1k views

Controller of new Visualforce page is not finding records inserted in the calling Apex class

I have a weird situation going on and I am not able to understand why? Here is my scenario I will try to provide a simple example, I have an Apex class inserting a Contact, I am referencing a ...
2
votes
1answer
1k views

Identify the current page name

In my apex controller how can I find out what my current page name is? I have need where I am redirecting from one page to another. My first page does not have any parameters but my 2nd page has a ...
2
votes
1answer
334 views

PageReference not redirecting inside another method

I am calling referencepage method named Done inside another method that is being called on an command button called Save however the pagereference is not doing anything and it just stays on the same ...
2
votes
2answers
5k views

URL Encoding in Apex - PageReference to Merge Accounts

Following to my previous question - Merge Accounts based on Account Number. I have written a Visualforce page with a selectable table list of Accounts. When selecting the accounts and pressing the ...
2
votes
1answer
192 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 ...
2
votes
1answer
1k views

View state size limit & de-reference null for transient

I have below code to allow multiple file attachments to be inserted against a parent record id. But this results in either View state size limit exceeded (not all the time) or dereferencing null ...
2
votes
2answers
300 views

How to use pagereference outside a method

I am used to using PageReference in a method like so: public PageReference transPage() { PageReference newPage = page.PAGE_NAME; newPage.getParameters().put('ContactId', selContact.Id); ...
2
votes
1answer
888 views

Why won't salesforce recognize relative URL?

On clicking a button my visualforce page is supposed to redirect to the saveURL defined in my get parameters. The saveURL is literally just the ID of an object (usually an account), here is the apex: ...
2
votes
2answers
548 views

PageReference Does Not Direct to selected Radio Button

I have an apex class that brings up duplicates when a user enters in an account name in the search box on the visualforce page. The only thing I can't figure out is when there is more than one ...
2
votes
2answers
2k views

ActionFunction working in Chrome but not in IE and Moz

So, the page has an action which must be invoked when "enter" is pressed. VISUALFORCE: //script: function pressReturn(e, currOffer) { var keyPressed = e.keyCode; if (keyPressed == 13) { ...
2
votes
4answers
671 views

Ensuring a all controllers invoke a method

I want to apply this fix to an IE 10 problem. The thing is you could argue this fix should be applied to all controllers. I was thinking of having a base controller putting it in that and then all ...
2
votes
4answers
1k 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 ...
2
votes
1answer
247 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 ...
2
votes
1answer
255 views

?isdtp=mn - Pop Task Page with no sidebar or headers

I have a custom button on Lead, "Log A Call", that pops a new window. The new window is the Task object edit page. Currently "Log A Call" button pops: /00T/e?title=Call&who_id={!Lead.Id}&...
2
votes
3answers
3k views

Visualforce Page redirect not working from apex actionfunction

I have used actionfunction to redirect visualforce page to another page but the page is not redirecting into another. VF Page: <apex:commandButton value="Create" onclick="createfunction()" /> &...
2
votes
1answer
817 views

Page.existingPageName page instantiation says Variable doesn't exist

I've got a method that redirects to another page. It does work this way: public PageReference redirectToSetup() { return Page.SetupPage; } and this way: public PageReference redirectToSetup() { ...
2
votes
1answer
2k views

Create new record in one controller and pass Id to a second controller

Still pretty 'green' when it comes to Apex and I am having a difficult time with this one issue. So, I have a Visualforce page that replaces Orders to replicate the button 'Save and Add Product' ...
2
votes
1answer
3k views

ActionStatus on a visualforce page for a PageReference method

I have been using actionStatus on visualforce pages since a long time but never came across a scenario where the method for which I use it is a PageReference method. AJAX, as far as I understand, is ...
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 ...
2
votes
2answers
674 views

How to redirect to desired VF page(For recordType A of Object Y/Child) when coming from Related list of recordType A of Object X/Parent

There are two objects X(Parent) and Y(Child),each having two recordTypes viz 'RecordType A' and 'RecordType B'. Requirement 1.If user clicks on new button from tab of Child object, Standard ...
2
votes
1answer
45 views

Bypass entry when object not desired on Wizard

I have a case entry wizard, duped and revised from the Visualforce in Practice workbook. My second page asks the users if they want to add Case Team Members. If they put a user in the name box, they ...
2
votes
1answer
3k views

How to pass a value to a global variable in apex

public PageReference BookerInformation(){ PageReference gotosetup = new PageReference('/apex/bookerinformation?id=' + eventId); List<ProntoEvents_Product__c> products_1 = [...
2
votes
2answers
505 views

Unable to Open VF Page using PageReference for given URL

I have called NextStep() on Button Click where I wanted to open a standard VF page provided by SF with some new additional parameters in URL - where my string MergeURL is just fine, but it gets ...
2
votes
3answers
4k views

Passing apex:inputField user entry as parameter into Command Link

I am getting the nickname from an inputField and updating a list of strings and displaying the list of strings on a table. The outputField displays the newly entered value, but the controller variable ...
2
votes
0answers
228 views

Apex help needed for flow finish location

I am trying to set the Finish Location for my flow to either go to the detail page of the Opp created by the flow or reload the flow. My VF page and Apex controller are below. I'm getting an error: ...
2
votes
1answer
1k views

Redirecting from Controller to standard list view page?

I'm using a custom_object and once the user save I want that page to redirect to list view page but what is happening is that right after i click save button i see the white blank screen with the ...
2
votes
1answer
188 views

Any way to get a PageReference.setRedirect(true) to return a 302 status and location rather than some JavaScript that submits a form?

I am attempting to invoke a short sequence of Visualforce pages from an external system (i.e. server-side) rather than a browser. A GET of one of the Visualforce pages does a client-side redirect via ...
2
votes
2answers
2k views

Redirect to an external site passing variables

I am working on a Visualforce page that will call our internal report server with a few parameters from the page to run a report. However the URL I am calling has a secondary path after the initial ...
2
votes
0answers
450 views

redirect to mobile detail page layout from flow

I am creating a custom object record via a flow. At the end of the flow, the user is redirected to the detail of the record that has just been created in order to add some attachment. Users will use ...
2
votes
2answers
4k views

How to test apex classes with Pagereference?

I'm struggling to test a class with pagereference. Following is the class... public with sharing class redirectOrderPartner{ public String currentRecordId {get;set;} public orders__c orderId {get;...
2
votes
0answers
108 views

Email a PDF page to User who clicks

I have a custom button on Custom object Incident. When it is clicked from a particular Incident record a VF page is displayed in PDF format. I need not to show this PDF to the User instead the PDF ...
2
votes
2answers
2k views

How to Call two action from one Command Link? [duplicate]

I have to call 2 URL on click of command Link , one will Record Edit Page URl and Another is different Webserver URl I have tried two Ways Both are Not Working.....I mean both action is Not ...
1
vote
1answer
534 views

Making a PageReference absolute

I have a controller that return PageReferences. This are all relative. But in some cases, I need to return back full URLs. Something like: http://www.google.com This works but, I want to be 100% ...
1
vote
4answers
6k views

Redirect after a new record is save from Trigger

I want to redirect the user to a new page after a new record of a custom object CIP System is created from a Trigger. Is this possible? Here is the code I was using: trigger SaveRedirect on ...
1
vote
1answer
28 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.*...
1
vote
1answer
2k 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 : ...
1
vote
1answer
144 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
664 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
1k 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/...