VisualForce Error: Formula Expression is required on the action attributes. To save

I have read other answer regarding the same problem but still, it doesn’t change anything at all, I still get the error…

I’m trying to save the details in the form to salesforce but it says

“Formula Expression is required on the action attributes. “

when I tried saving it.

<apex:pageBlock >
   <apex:pageBlockButtons >
      <apex:commandButton value="Save" action="!save"/>
      <apex:commandButton value="Cancel" action="!cancel"/>
   </apex:pageBlockButtons>
</apex:pageBlock >

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

You are getting this error because you have not used formula expression in

<apex:commandButton value="Save" action="!save"/>
<apex:commandButton value="Cancel" action="!cancel"/>

for both commandbuttons.
Use as

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

Thanks,

Method 2

Formula expression implies other notation of the action attribute:

action="!save"

should be

action="{!save}"

Same for cancel action.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x