You need to sign in to do that
Don't have an account?
Hi Team, I am new to development. I have created a VF page which is not saving the Lead details once I hit the save button. Please help!
<apex:page standardController="Lead">
<apex:form >
<apex:pageBlock title="New Lead">
<apex:pageBlockSection columns="2">
<apex:inputtext value="{!Lead.Name}" label="Name"/>
<apex:inputfield value="{!Lead.Email}" label="Email"/>
<apex:inputfield value="{!Lead.Status}" label="Status"/>
<apex:inputfield value="{!Lead.MobilePhone}" label="Mobile Phone"/>
<apex:inputfield value="{!Lead.Company}" label="Company Name"/>
<apex:inputfield value="{!Lead.AnnualRevenue}" label="Annual Revenue"/>
<apex:inputfield value="{!Lead.Fax}" label="Fax"/>
<apex:inputfield value="{!Lead.Title}" label="Title"/>
<apex:inputfield value="{!Lead.Website}" label="Website"/>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton action="{!Save}" value="Save"/>
<apex:commandButton action="{!Cancel}" value="Cancel"/>
<apex:commandButton action="{!Edit}" value="Edit"/>
<apex:commandButton action="{!View}" value="View"/>
<apex:commandButton action="{!Delete}" value="Delete"/>
</apex:pageBlockButtons>
</apex:pageBlock>
<apex:detail relatedList="true"/>
</apex:form>
</apex:page>
<apex:form >
<apex:pageBlock title="New Lead">
<apex:pageBlockSection columns="2">
<apex:inputtext value="{!Lead.Name}" label="Name"/>
<apex:inputfield value="{!Lead.Email}" label="Email"/>
<apex:inputfield value="{!Lead.Status}" label="Status"/>
<apex:inputfield value="{!Lead.MobilePhone}" label="Mobile Phone"/>
<apex:inputfield value="{!Lead.Company}" label="Company Name"/>
<apex:inputfield value="{!Lead.AnnualRevenue}" label="Annual Revenue"/>
<apex:inputfield value="{!Lead.Fax}" label="Fax"/>
<apex:inputfield value="{!Lead.Title}" label="Title"/>
<apex:inputfield value="{!Lead.Website}" label="Website"/>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton action="{!Save}" value="Save"/>
<apex:commandButton action="{!Cancel}" value="Cancel"/>
<apex:commandButton action="{!Edit}" value="Edit"/>
<apex:commandButton action="{!View}" value="View"/>
<apex:commandButton action="{!Delete}" value="Delete"/>
</apex:pageBlockButtons>
</apex:pageBlock>
<apex:detail relatedList="true"/>
</apex:form>
</apex:page>
Thanks Krishna
All Answers
Thanks Krishna
Thanks Krishnamoorthi. Thanks a lot!
Hare Krishna :)
Instead of using
<apex:inputtext value="{!Lead.Name}" label="Name"/>
Use below
<apex:inputtext value="{!Lead.FirstName}" label="FirstName"/>
<apex:inputtext value="{!Lead.LastName}" label="LastName"/>
--
Regards
Sharan Desai
+91 966 33 11 740