You need to sign in to do that
Don't have an account?
Vigneshwaran Loganathan
Hi,
I am Creating records thru Visualforce page. Everytime I hit Save button only Id gets generated and Entered values are shown Blank.
VF
Thanks,
VF
<apex:page standardController="Tandure_Domain__c" sidebar="false" extensions="attachementsample"> <apex:form > <apex:pageblock > <apex:pageblockbuttons location="Bottom"> <apex:commandButton value="Save" action="{!Save1}" disabled="{!save}"/> </apex:pageblockbuttons> <apex:pageblockSection title="Salesforce"> <apex:inputField value="{!Tandure_Domain__c.Name__c}"/> <apex:inputField value="{!Tandure_Domain__c.Education__c}"/> </apex:pageblockSection> </apex:pageblock> </apex:form> </apex:page>Class
public class attachementsample { public tandure_domain__c dom{get;set;} String accid = System.currentPagereference().getParameters().get('id'); public attachementsample(ApexPages.StandardController controller) { dom=new tandure_domain__c(); } public void save1() { Database.upsert(dom); system.debug('>>>>>'+dom); // Education and Name fields are Blank here, Only Id got generated } }
Thanks,
You need to map your dom variable with the controller.
Please add the below assignment to your constructor.
dom = (tandure_domain__c)controller.getRecord();
This will map your page values to your class.
Regards,
Prakash B
All Answers
You need to map your dom variable with the controller.
Please add the below assignment to your constructor.
dom = (tandure_domain__c)controller.getRecord();
This will map your page values to your class.
Regards,
Prakash B