You need to sign in to do that
Don't have an account?
rebvijkum
how can i get id from url in visualforcepage
my vfp code:
<apex:page controller="GetURLCOREnew">
<apex:outputText value="{!myurll}"/>
</apex:page>
controller:
public class GetURLCOREnew {
public string sfURL= System.URL.getSalesforceBaseUrl().getHost();
public string myURL= 'https://'+sfUrl+'/apex/CoreBenefit_PDF?id='+;
public String getsfurll() {
return sfURL;
}
public String getmyurll() {
return myURL;
}
}
the outpul should be: https://vsp--kmbuild--c.cs10.visual.force.com/apex/CoreBenefit_PDF?id=kA3J0000000CbHQ
i should get the id from the visualforce page
Thanks in advance
<apex:page controller="GetURLCOREnew">
<apex:outputText value="{!myurll}"/>
</apex:page>
controller:
public class GetURLCOREnew {
public string sfURL= System.URL.getSalesforceBaseUrl().getHost();
public string myURL= 'https://'+sfUrl+'/apex/CoreBenefit_PDF?id='+;
public String getsfurll() {
return sfURL;
}
public String getmyurll() {
return myURL;
}
}
the outpul should be: https://vsp--kmbuild--c.cs10.visual.force.com/apex/CoreBenefit_PDF?id=kA3J0000000CbHQ
i should get the id from the visualforce page
Thanks in advance
my vfp code:
<apex:page controller="GetURLCOREnew">
<apex:outputText value="{!myurll}"/>
</apex:page>
controller:
public class GetURLCOREnew {
public string sfURL= System.URL.getSalesforceBaseUrl().getHost();
public string myURL{get;set;}
public GetURLCOREnew(){
String currentParam = ApexPages.currentPage().getparameters().get('ID');
myURL= 'https://'+sfUrl+'/apex/CoreBenefit_PDF?id='+ currentParam;
}
}
Is it , what you needed?
All Answers
https://www.salesforce.com/us/developer/docs/pages/Content/pages_quick_start_query_params_getting.htm
-Bronco
i used {!$CurrentPage.parameters.id}, but didn't got the id.
Example:
Visualforce Code:
<apex:param value="{!$CurrentPage.parameters.id}" assignTo="{!IdChosen}" name="contIdParam" />
Apex Code:
public String IdChosen
{
get;
set;
}
Explanation:
So the <apex:param> component will store the Id parameter using the value attribute then using the assignTo attribute, it will assign that value to the idChosen property.
Potentiall Helpful References:
http://blog.jeffdouglas.com/2010/03/03/passing-parameters-with-a-commandlink/
https://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_param.htm
{!JSENCODE($CurrentPage.parameters.id)}
my vfp code:
<apex:page controller="GetURLCOREnew">
<apex:outputText value="{!myurll}"/>
</apex:page>
controller:
public class GetURLCOREnew {
public string sfURL= System.URL.getSalesforceBaseUrl().getHost();
public string myURL{get;set;}
public GetURLCOREnew(){
String currentParam = ApexPages.currentPage().getparameters().get('ID');
myURL= 'https://'+sfUrl+'/apex/CoreBenefit_PDF?id='+ currentParam;
}
}
Is it , what you needed?