Formula Expression is required on the action attributes error occurs when pagereference('/apex/pageName') doesn't have backslash in front of apex.
Correct: pagereference('/apex/sample1');
Incorrect: pagereference('apex/sample1');
in incorrect, backslash ('/') is missing in front of apex.
Cheers!!!
Correct: pagereference('/apex/sample1');
Incorrect: pagereference('apex/sample1');
in incorrect, backslash ('/') is missing in front of apex.
Cheers!!!
Hey! thanks a lot for that information it is truly helpful
ReplyDeleteThis error will also occur if you try to return something from the action attribute call of an apex:commandButton. For instance:
ReplyDeletein page:
<apex:commandButton action="{!getData}" value="Create Sandbox Data"/>
in controller:
public String getData() {
String result;
Boolean success = true;
// create some data
return result = success ? 'Data created with success.' : 'Problems were encountered creating sandbox data. Refer to logs for details.';
}
Thanks!
ReplyDeleteI spent an hour to detect this one. Thanks a ton! :)
ReplyDelete