Here is my controller class
public class OEM_Target_Controller {
public String currentRecordId {get;set;}
public String parameterValue {get;set;}
public OEM_Target__c oem {get;set;}
public Opportunity_Product_Line_item__c oppProItem {get;set;}
public OEM_Target_Controller(){
//for details in current page section
currentRecordId = ApexPages.CurrentPage().getparameters().get('id');
system.debug('currentRecordId' + currentRecordId);
oem = [select Id, Name,Year__c,Month__c,OEM__c,Product_Category__c,User__c,Target_In_Revenue__c,Target_In_GP__c from OEM_Target__c where id =: currentRecordId ];
parameterValue = ApexPages.CurrentPage().getparameters().get('name');
//for actual amount and gross profit section
Id user = oem.User__c;
string oemVal = oem.OEM__c;
string year = oem.Year__c;
string productCategory = oem.Product_Category__c;
string month = oem.Month__c;
String stage = 'Won';
Decimal ToatlAmount=0;
Decimal GP=0;
List<String> lstmonth = month.split(';');
System.debug(lstmonth);
String Query = 'select id ,name ,Opportunity_Name__c , Stage__c,Gross_Profit_Custom__c,Total_Price_Custom__c,OEM__c,Product_Category__c,Vertical_Manager__c,Month__c,Year__c from Opportunity_Product_Line_item__c where OEM__c =:oemVal and Product_Category__c=:productCategory and Year__c=:year and Stage__c=:stage and Month__c IN=:lstmonth ' ;
System.debug('Query=='+Query);
List<Opportunity_Product_Line_item__c> lstoppProItem = Database.query(Query);
System.debug('lstoppProItem=='+lstoppProItem);
if(lstoppProItem!=null && lstoppProItem.size()>0)
{
for(Opportunity_Product_Line_item__c obj :lstoppProItem)
{
if(obj.Gross_Profit_Custom__c !=null)
GP = GP+ obj.Gross_Profit_Custom__c;
if(obj.Total_Price_Custom__c !=null)
ToatlAmount = ToatlAmount+obj.Total_Price_Custom__c;
}
}
system.debug('lstoppProItem'+lstoppProItem);
}
}
I'm facing this error: expecting a colon, found '=' An unexpected error has occurred. Your development organization has been notified. on Query Line