+ Start a Discussion
bharath lagishettybharath lagishetty 

Formula Expression is required on the action attributes.

please help me to solve this when i enter the values and claic on save fomula expression error is coimng

<apex:page controller="harish">
  <apex:form >
  <apex:pageBlock >
  <apex:commandButton value="save" action="harik"/>
  <apex:pageblockSection >
  
  
  <apex:outputLabel value="fax"></apex:outputLabel>
  <apex:inputText value="{!fax}"/>
  <apex:outputLabel value="phone"></apex:outputLabel>
  <apex:inputText value="{!phone}"/>
  </apex:pageblockSection>
  </apex:pageBlock>
  </apex:form>
</apex:page>

class
public class harish {
 public string name{get;set;}
 public string fax{get;set;}
 public string phone{get;set;}
 
 public void harik(){
 lead ac=new lead();
 ac.fax=fax;
 ac.phone=phone;
 insert ac;
 }
}
kevin lamkevin lam
You need to change the action attribute of the commandButton:

<apex:commandButton value="save" action="{!harik}"/>
kumar tanwarkumar tanwar
Hello bharath,
If we bind any server side action and variable then we use Formula Expression.Like:-
{!ServerSideAction}
You replace code with below code:
<apex:commandButton value="save" action="{!harik}"/>
For more detail see below link.:-
https://www.salesforce.com/docs/developer/pages/Content/pages_compref_commandButton.htm