You need to sign in to do that
Don't have an account?
MeWorkingman
How do you access query parameters from VisualForce page in tab?
I have created a VisualForce page that I want to access via a VisualForce tab named myVFTab. I want to pass a query parameter to the VF page like this:
https://salesforce_server/one/one.app#/n/myVFTab?usePrintId=mytest
As you can see, I'm accessing the tab in lightning but I don't think that is relevant to my question.
I am trying to access the "usePrintId" parameter in my VF page like this:
How do I make sure that the parameter in the tab request is available in the contained VF page?
https://salesforce_server/one/one.app#/n/myVFTab?usePrintId=mytest
As you can see, I'm accessing the tab in lightning but I don't think that is relevant to my question.
I am trying to access the "usePrintId" parameter in my VF page like this:
<apex:page> These parameters were passed in:<br/> <br/> PrintId: {!$CurrentPage.parameters.usePrintId} </apex:page>If I access the VF page directly, the "usePrintId" parameters prints out correctly but if I try to view the tab, the "usePrintId" is always blank.
How do I make sure that the parameter in the tab request is available in the contained VF page?
Passing parameters in the URL is not possible with a custom tab associated with a VFP.
From Apex or a URL button, you can call the VFP directly with parameters as you noticed.
You can use tabs (sub tabs) inside an existing VFP (same main tab) on the other hand. I used these tabs for my own technical tool.
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_tabPanel.htm
This custom VFP tab are used for independant pages in the application with a prepopulated dropdown menu for example and a custom controller as described here: We have used them like that
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_custom.htm
@Alain Cabon: That was what I figured; it just isn't possible to do when invoking a custom tab. I was just hoping that maybe I was missing something. Unfortunately, I can't use tabs within the currently-displayed VFP page because I'm trying to implement a view link that is displayed on a list view so my code isn't a part of an existing VFP. I'm trying to implement this in Lightning, so is it possible to create a URL that invokes a Lightning tab that displays a Lightning page app in the tab and then access the parameter in the Lightning app? I'm still pretty new to Lightning so I'm not sure what all can be done when invoking Lightning tabs.
Thanks again.