Second day of being a coder and I'm getting this error...
line 1:70 no viable alternative at character '"' Error is in expression '{!search}' in component apex:commandButton in page unopenedcasespage: Class.UnopenedCases.search: line 6, column 1
An unexpected error has occurred. Your development organization has been notified.
Here's the code...
Apex Class
public with sharing class UnopenedCases {
public list <Case> cas {get;set;}
public String searchKey {get;set;}
public void search(){
string searchquery='SELECT parentId.caseNumber, parentId.subject FROM case WHERE status = "0"';
cas= Database.query(searchquery);
}
public void clear(){
cas.clear();
}
}
VF Page
<apex:page controller="UnopenedCases">
<apex:form>
<apex:commandButton value="Clear records" action="{!clear}"/>
<apex:commandButton value="Search records" action="{!search}"/>
<apex:pageBlock title="Search Result">
<apex:pageBlockTable value="{!cas}" var="c">
<apex:column value="{!c.subject}"/>
<apex:column value="{!c.caseNumber}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
I've tried unticking smart quotation marks on my mac and rewriting the whole thing but nothing I've tried has done anything.
Any help would be greatly appreciated.