Special characters not allowed

salesforce

#1

Hi,

I’ve encountered a couple of strange errors when trying to code a query, and was wondering whether this has any workaround. I’m trying to run a search using LIKE, for instance:
String strQuery = ‘SELECT Id FROM Contact WHERE FirstName LIKE ‘myname%’’;

This code generates 2 errors, which I think come from c9 itself and not from Salesforce:

  1. Found punction symbol or operator ‘%’ that isn’t valid in Apex.
  2. Unrecognized symbol ‘’, which is not a valid Apex identifier.

Now I know the actual code can compile, because it’s old code I’ve since since before using c9.

Has anyone seen this before, and has any workarounds?

Thanks!