You need to sign in to do that
Don't have an account?
sri divya
hi every one i am new to sfdc i need help i am trying to insert records through vf page in my custom sobject there is no error in my prog its showing but i am not able to insert the record
this is my vf page
<apex:page showHeader="false" sidebar="false" controller="bankform1">
<apex:form >
<apex:commandButton value="save and new" action="{!savenew}"/>
<apex:commandButton value="cancel" action="{!cancel}"/>
<apex:commandButton value="dipaly" action="{!display}"/>
<apex:sectionHeader title="bank" subtitle="bank form"/>
<apex:pageBlock title="personal info">
<apex:pageBlockSection title="bankform1">
<apex:pageBlockSectionItem >
<apex:outputLabel >account holder Name</apex:outputLabel>
<apex:inputText value="{!c_Name}"/>
</apex:pageBlockSectionItem><br/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
and this is my controller
public class bankform1 {
public String c_Name { get; set; }
public PageReference display() {
return null;
}
public PageReference cancel() {
return null;
}
public PageReference savenew() {
return null;
}
public PageReference save()
{
bankform1__c obj = new bankform1__c();
obj.name=c_Name;
insert obj;
return null;
}
}
<apex:page showHeader="false" sidebar="false" controller="bankform1">
<apex:form >
<apex:commandButton value="save and new" action="{!savenew}"/>
<apex:commandButton value="cancel" action="{!cancel}"/>
<apex:commandButton value="dipaly" action="{!display}"/>
<apex:sectionHeader title="bank" subtitle="bank form"/>
<apex:pageBlock title="personal info">
<apex:pageBlockSection title="bankform1">
<apex:pageBlockSectionItem >
<apex:outputLabel >account holder Name</apex:outputLabel>
<apex:inputText value="{!c_Name}"/>
</apex:pageBlockSectionItem><br/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
and this is my controller
public class bankform1 {
public String c_Name { get; set; }
public PageReference display() {
return null;
}
public PageReference cancel() {
return null;
}
public PageReference savenew() {
return null;
}
public PageReference save()
{
bankform1__c obj = new bankform1__c();
obj.name=c_Name;
insert obj;
return null;
}
}
Try below code
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
Best Regards
Sandhya
Error: bankform1 Compile Error: Unexpected token 'bankform1__c'. at line 1 column 8
please check the API name of bankform1__c and use it in the code