function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lukasz PiziakLukasz Piziak 

TestExtension Compile Error: unexpected token: Where at line 8 column 96

Help please, 

public class TestExtension {
    public List<SCMC__Production_Order__c> objlist{get;set;}
    public List<SCMC__Sales_Order__c> salesOrderList{get;set;}
    public TestExtension(ApexPages.StandardSetController controller) {
    objlist = [SELECT Name, Sales_Order_No__c,Customer__c, Assembly_Name__c, SCMC__Start_Date__c, SCMC__Planned_Completion_Date__c, SCMC__Production_Status__c
FROM SCMC__Production_Order__c Where SCMC__Production_Status__c = 'Pending Pulling All Items'ORDER by SCMC__Planned_Completion_Date__c];

    salesOrderList = [SELECT Name, SCMC__Customer_Account__c, Type__c, SCMC__Current_Promise__c Where Type__c = 'Production Sales Order' Order by SCMC__Current_Promise__c];
    }
}
Best Answer chosen by Lukasz Piziak
KaranrajKaranraj
You missed "FROM ObjectName" in the final query statement
salesOrderList = [SELECT Name, SCMC__Customer_Account__c, Type__c, SCMC__Current_Promise__c From SCMC__Sales_Order__c Where Type__c = 'Production Sales Order' Order by SCMC__Current_Promise__c];



 

All Answers

Andy BoettcherAndy Boettcher
Take those SOQL queries and execute them in Developer Console - it's a syntax issue somewhere in one of those.
KaranrajKaranraj
You missed "FROM ObjectName" in the final query statement
salesOrderList = [SELECT Name, SCMC__Customer_Account__c, Type__c, SCMC__Current_Promise__c From SCMC__Sales_Order__c Where Type__c = 'Production Sales Order' Order by SCMC__Current_Promise__c];



 
This was selected as the best answer
Lukasz PiziakLukasz Piziak
Thanks Karanaj,
I have amended missing 'FROM' and I was able to save without any errors. I have added all this fields to my VF page and infortunately page is not dispaying records which match the criteria. Can you advise what I'm doing wrong?

VF page

</apex:form>
<apex:pageBlock rendered="True" title="Production Sales Orders">
<apex:pageBlockSection title="Production Sales Orders to Fill">
<apex:pageBlockTable value="{!salesOrderList}" style="width:1220px" var="item">
<apex:column style="width:100px" headerValue="Sales Order No.">
<apex:outputLink value="/{!item.id}" target="_blank">
{!item.Name}
</apex:outputLink>
</apex:column>
<apex:column style="width:100px" value="{!item.SCMC__Customer_Account__c}" headerValue="Customer Name"/>
<apex:column style="width:100px" value="{!item.Type__c}" headerValue="Order Type"/>
<apex:column style="width:100px" value="{!item.SCMC__Current_Promise__c}" headerValue="Promise Date"/>
</apex:pageBlockTable>

Controller

public class TestExtension {
    public List<SCMC__Production_Order__c> objlist{get;set;}
    public List<SCMC__Sales_Order__c> salesOrderList{get;set;}
    public TestExtension(ApexPages.StandardSetController controller) {
    objlist = [SELECT Name, Sales_Order_No__c,Customer__c, Assembly_Name__c, SCMC__Start_Date__c, SCMC__Planned_Completion_Date__c, SCMC__Production_Status__c
FROM SCMC__Production_Order__c Where SCMC__Production_Status__c = 'Pending Pulling All Items'ORDER by SCMC__Planned_Completion_Date__c];

    salesOrderList = [SELECT Name, SCMC__Customer_Account__c, Type__c, SCMC__Current_Promise__c From SCMC__Sales_Order__c Where Type__c = 'Production Sales Order' Order by SCMC__Current_Promise__c];

    }
}