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

ERROR: Formula Expression is required on the action attributes.

Hi All,


Public pageReference redirectaction(){ 


update ssss; //Database operation before redirection


String url = '';

PageReference pr = new PageReference(url);


return pr;




This is throwing the following error:  Formula Expression is required on the action attributes.


I want this to be done using commandbutton action.. Becoz before redirection I have to perform some database operation.


Could you please help me in getting this resolved?


Thanks in Advance.




Hi Natraj,


I think the problem is with the way you are calling this function(redirectaction) from the <apex:commandButton>

Sample code is : <apex:commandButton action="{!your function name}" value="your button name" />


Please let me know if any issues apart from this.