0
queryStr+ = 'AND Sales_Order__r.sales_year__c =' +\'' +:strYear+\'';

This is my string.strYear is the year value which i want to add dynamicaly.

I am getting an error "Compile Error: unexpected token: '=' "

Can someone help please

  • queryStr+ = 'AND Sales_Order__r.sales_year__c = :strYear'; – kurunve Apr 19 '16 at 9:38
  • try queryStr+ = 'AND Sales_Order__r.sales_year__c =\''+Name+'\'' – Ratan Paul Apr 19 '16 at 9:39
  • its giving me the same error as before – Samir Apr 19 '16 at 9:47
2

You should change your code to:

queryStr += 'AND Sales_Order__r.sales_year__c = :strYear ';

I think you had a space between + and =

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.