<apex:page controller="c1" showHeader="false" sidebar="false">
<apex:form>
<apex:pageBlock>
<apex:pageBlockSection title="Login page">
<apex:inputText label="Name" title="Name" value="{!Name}"/>
<apex:inputText label="Ucode" title="Ucode" value="{!Ucode}"/>
</apex:pageBlockSection>
<apex:commandButton value="Dep" action='{!Dep}'/>
</apex:pageBlock>
</apex:form>
</apex:page>
public class c1 {
public string Name{set;get;}
public string Ucode{set;get;}
PageReference P1;
public PageReference Dep() {
Employee__c obj;
obj=[select Emp_Name__c,Ucode__c from Employee__c where Emp_Name__c='Saurabh' AND Ucode__c='MG356'];
if(obj!=null){
P1 =new PageReference('www.google.com/');
}
else {
P1 =new PageReference('https://mail.google.com/mail/u/0/#inbox');
}
return P1;
}
}
Why it is showing this error?
Formula Expression is required on the action attributes
visualforce
. Could you make an edit to accomplish those changes?