You need to sign in to do that
Don't have an account?
renaiah anamalla 6
I have getting error
apex code:
public class firstcon11 {
public string name {get;set;}
public String phone {get;set;}
public firstcon11(){
}
public pagereference save() {
ABC__c a= New ABC__c();
a.name=name;
a.Phone__c= phone;
insert a;
PageReference demoPage = new PageReference(a);
return demoPage;
}
}
Vfpage:
<apex:page controller="firstcon11">
<apex:form>
<Apex:pageBlock title="ABC details">
Name:<apex:inputText/><br/><br/>
Phone:<Apex:inputtext/><br/>
<apex:commandButton value="save" action="{!save}"/>
</Apex:pageBlock>
</apex:form>
</apex:page>
please share ur knowledge
public class firstcon11 {
public string name {get;set;}
public String phone {get;set;}
public firstcon11(){
}
public pagereference save() {
ABC__c a= New ABC__c();
a.name=name;
a.Phone__c= phone;
insert a;
PageReference demoPage = new PageReference(a);
return demoPage;
}
}
Vfpage:
<apex:page controller="firstcon11">
<apex:form>
<Apex:pageBlock title="ABC details">
Name:<apex:inputText/><br/><br/>
Phone:<Apex:inputtext/><br/>
<apex:commandButton value="save" action="{!save}"/>
</Apex:pageBlock>
</apex:form>
</apex:page>
please share ur knowledge
Check the Trailhead visualforce module for more details - https://developer.salesforce.com/trailhead/module/visualforce_fundamentals