You need to sign in to do that
Don't have an account?
sfg1
display campaign id in SITE using visualforce page
I tried to display campaign id in site using visulforce page, but i am not able to display.My code is not working fine. Can i use standard controller? if not please let me know. Whether i need to try different code for SITES. please guide me.
class:
public class CampaignRecordIdController{
public String campaignRecordId {get;set;}
public String parameterValue {get;set;}
public Campaign cam{get;set;}
public CampaignRecordIdController(ApexPages.StandardController controller) {
campaignRecordId = ApexPages.CurrentPage().getparameters().get('id');
cam = [select name,Promotion_Details__c from Campaign where id =: campaignRecordId ];
parameterValue = ApexPages.CurrentPage().getparameters().get('nameParam');
}
}
Page:
public class CampaignRecordIdController{
public String campaignRecordId {get;set;}
public String parameterValue {get;set;}
public Campaign cam{get;set;}
public CampaignRecordIdController(ApexPages.StandardController controller) {
campaignRecordId = ApexPages.CurrentPage().getparameters().get('id');
cam = [select name,Promotion_Details__c from Campaign where id =: campaignRecordId ];
parameterValue = ApexPages.CurrentPage().getparameters().get('nameParam');
}
}
class:
public class CampaignRecordIdController{
public String campaignRecordId {get;set;}
public String parameterValue {get;set;}
public Campaign cam{get;set;}
public CampaignRecordIdController(ApexPages.StandardController controller) {
campaignRecordId = ApexPages.CurrentPage().getparameters().get('id');
cam = [select name,Promotion_Details__c from Campaign where id =: campaignRecordId ];
parameterValue = ApexPages.CurrentPage().getparameters().get('nameParam');
}
}
Page:
public class CampaignRecordIdController{
public String campaignRecordId {get;set;}
public String parameterValue {get;set;}
public Campaign cam{get;set;}
public CampaignRecordIdController(ApexPages.StandardController controller) {
campaignRecordId = ApexPages.CurrentPage().getparameters().get('id');
cam = [select name,Promotion_Details__c from Campaign where id =: campaignRecordId ];
parameterValue = ApexPages.CurrentPage().getparameters().get('nameParam');
}
}
class:
All Answers
https://yoursalesforceinstance.com/VFPAGE?id='your campaign id'
page:
<apex:page standardController="Campaign" Extensions="CampaignRecordIdController">
<apex:pageBlock >
<!--<apex:pageBlockSection title="Current Campaign record Id is : {!campaignRecordId}" collapsible="false">
<apex:outputField value="{!cam.name}"/>
<apex:outputField value="{!cam.Promotion_Details__c}"/>
</apex:pageBlockSection>-->
</apex:pageBlock>
</apex:page>
class:
public class CampaignRecordIdController{
public String campaignRecordId {get;set;}
public String parameterValue {get;set;}
public Campaign cam{get;set;}
public CampaignRecordIdController(ApexPages.StandardController controller)
{
campaignRecordId =System.currentPageReference().getParameters().get('id');
cam = [select name,Promotion_Details__c from Campaign where id =: campaignRecordId ];
//parameterValue = ApexPages.CurrentPage().getparameters().get('nameParam');
}
}
class:
make sure that the VF page you are accessing must be added to your site page list as well.