Skip to main content
I am new to salesforce environment and I am trying to achieve simple thing. I want to create new Lead screen with custom lead questions and save that as a Lead.

 

I created apex form, overridden new lead button page, but when I press save button on that page, I dont get any error but it also doesnt save the Lead. Cancel button seems to be working.

 

Do I need to write custom code for save  (and how do I do that) or apex:pageblockbuttons default action should work ?

 

I will just show short snippet of the code, as most of it is just setting the input fields

<apex:form id="mySection">

<apex:pageBlock title="New Lead: {!Lead.Name}">

<apex:pageBlockSection title="Lead information" columns="1" >

<apex:inputField value="{!Lead.FirstName}" tabOrderHint="1"/>

<apex:inputField value="{!Lead.LastName}" tabOrderHint="2"/>

<!-- Other fields are skipped -->

<apex:inputField value="{!Lead.Project_Value__c}" tabOrderHint="3"/>

</apex:pageBlockSection>

<apex:pageBlockButtons >

<apex:commandButton action="{!save}" value="Save"/>

<apex:commandButton action="{!cancel}" value="Cancel" immediate="true"/>

</apex:pageBlockButtons>

</apex:pageBlock>

</apex:form>

 

 
3 respuestas
  1. 7 abr 2017, 12:47
    Hi, you will need to mention the Controller in apex:form tag

     

    Best
0/9000