I am new to SFDC. I have two Custom Objects both are having different VF Pages in my 1st custom object Registration__c
I have one field Email_id__c
. Every time if user enters value on Email field it should be Auto populate on my 2nd Custom Object FeedbackFrom__c
Registered Email Field.
My Apex Coding is:
public class CurrentRecordIdDemoController{
public String currentRecordId {get;set;}
public String parameterValue {get;set;}
public Registration__c Reg{get;set;}
public CurrentRecordIdDemoController(ApexPages.StandardController controller) {
currentRecordId = ApexPages.CurrentPage().getparameters().get('id');
Reg = [select id ,Email_id__c from Registration__c where id =: currentRecordId ];
parameterValue = ApexPages.CurrentPage().getparameters().get('nameParam');
}
}
My Vf Coding is:
<apex:page standardController="Registration__c" extensions="CurrentRecordIdDemoController">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection title="Your Email" collapsible="false">
<apex:outputField value="{!Reg.Email_id__c}"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Testing parameter" collapsible="false">
Name is <b>{!parameterValue}</b>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
please any help me out from this issue.
ApexPages.CurrentPage().getparameters().get('id')
this line of code will get the id from url – Ratan Paul Apr 3 '17 at 5:49PageReference pageRef = new PageReference('/apex/vf_page_name?id=recordId&nameParam=value); pageRef.setRedirect(true); return pageRef;
. This will return control to your page. – Rohit Mourya Apr 3 '17 at 6:14