You need to sign in to do that
Don't have an account?

ERROR: Formula Expression is required on the action attributes.
Hi,
I'm facing a weird error "Formula Expression is required on the action attributes".
My VF Page:
<apex:commandButton value="Log-in" action="{!loginTest}"/>
My Class:
public pagereference loginTest(){
pagereference redirect = new PageReference('apex/newPage');
redirect.setRedirect(true);
system.debug('Hello@@'+redirect);
return redirect;
}
But when I click on login button i'm facing a weird error 'Formula Expression is required on the action attributes'.
Syntax looks fine,but some how it is not working.
Any help is much appreciated :)
Hi Sachin,
Yo need to do a minor change in your "loginTest" method in the below line:
pagereference redirect = new PageReference('apex/newPage');
to pagereference redirect = new PageReference('/apex/newPage');
You need to put the forward slash in front of apex.
Please let me know if u have any problem on same and if this post helps you please throw KUDOS by click on star at left.
All Answers
Hi Sachin,
Yo need to do a minor change in your "loginTest" method in the below line:
pagereference redirect = new PageReference('apex/newPage');
to pagereference redirect = new PageReference('/apex/newPage');
You need to put the forward slash in front of apex.
Please let me know if u have any problem on same and if this post helps you please throw KUDOS by click on star at left.
Thanks..
somehow missed it..silly me :)
in page:
<apex:commandButton action="{!getData}" value="Create Sandbox Data"/>
in controller:
public String getData() {
String result;
Boolean success = true;
// create some data, set success flag accordingly
return result = success ? 'Data created with success.' : 'Problems were encountered creating sandbox data. Refer to logs for details.';
}
This works and provides feedback:
in page:
<apex:commandButton action="{!getData}" value="Create Sandbox Data"/>
<p />
<apex:repeat value="{!insertResults}" var="insertResult" id="results">
<apex:outputText value="{!insertResult}" /><br />
</apex:repeat>
in controller:
private void setInsertResults(String newString) {
insertResults.add(newString);
}
public List<String> getInsertResults() {
return insertResults;
}
public void getData() {
String result;
Boolean success = true;
// create some data, set success flag accordingly
result = success ? 'Data created with success.' : 'Problems were encountered creating sandbox data. Refer to logs for details.';
this.setInsertResults(result);
}
That solved my problem!
http://sales-fundamentals.blogspot.in/2014/09/how-to-navigate-to-another-page-visual.html
Hi pooja, i m trying to open a new page when click on button using commandLink.
its not working.
my email nareshsaini000111@gmail.com
,
I am trying to open a new thread but somehow it will not allow me to, dont know why !, newbie jerks prolly :(
But I am facing a similar error as above.
My VF Page:
<apex:page controller="BankDetailsController">
<apex:form >
<apex:pageBlock >
<apex:commandButton value="BANK" action="{!getbankDet}"/>
<apex:pageBlockSection>
Following are the Bank Details
{!Response}
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
My Controller: calls a web service which I imported as a Apex class in my org <basically its a web service written in another salesforce org of mine>
public class BankDetailsController {
//public string bank { get { return getbankDet(); } }
public String Response {get; set;}
public string getbankDet()
{
string accname = 'GoGlobalStrategies';
partnerSoapSforceCom.Soap myPartnerSoap = new partnerSoapSforceCom.Soap();
partnerSoapSforceCom.LoginResult partnerLoginResult = myPartnerSoap.login('somnath.paul4@cognizant.com', 'MyPasswordgPeEzXp6zqiICng3M8wKQtqd');
soapSforceComSchemasClassGetbankdet.SessionHeader_element webserviceSessionHeader=new soapSforceComSchemasClassGetbankdet.SessionHeader_element();
webserviceSessionHeader.sessionId = partnerLoginResult.sessionId;
soapSforceComSchemasClassGetbankdet.GetBankDetailsofAccount getBankdet=new soapSforceComSchemasClassGetbankdet.GetBankDetailsofAccount();
getBankdet.SessionHeader=webserviceSessionHeader;
Response = getBankdet.getBankDetails(accname);
return Response;
}
}
When I click on the BANK button in my VF Page, the response should flow in, but actually the error flows out :(
Can anyone tell me where am I going wrong here?
<apex:pageBlock >
<apex:form >
<apex:commandButton action="window.close()" value="Close" onclick="window.close()"/>
</apex:form>
</apex:pageBlock>
</apex:page>
same error ....please need help with this