function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Supriya P 9Supriya P 9 

Error Saying Formula Expression is required on the action attributes

Hello ,
In VF page I need to display value of Contract ID
In VF:
<apex:commandButton action="{!ClickForContract}" value="Contract Id"  />
<apex:outputText value="{!ContractId }"/>

In Class:
 public String ContractId {get; set;}
 public String ClickForContract() {
        Quote q=[Select id,Contract.id,Contract_ID__c from quote];
        ContractId=q.Contract.id;   return ContractId ; }
Please help me.
Sumit Kumar Singh 9Sumit Kumar Singh 9
Hello Supriya, 

Please, replace your method with the folowing. It should work.
public void ClickForContract() {
        Quote q = [Select id, ContractId, Contract_ID__c from quote LIMIT 1];
        ContractId = q.ContractId; 
}

Thanks,
Sumit Kuamar Singh
GauravGargGauravGarg

Hello Supriya,
 

Where exactly are you facing issue. VF page or class?

Thanks,
Gaurav

VineetKumarVineetKumar
Can you share the whole VF page code?