Skip to main content
added 117 characters in body
Source Link
Derek F
  • 64.1k
  • 15
  • 55
  • 104

The double quotes are what the error is complaining about, though it is hard to see the double quote in '"' in the error message. The double quotes appear in Where Profile_Name__c ="Portal JIT User".

Dobule quotes shouldn't be used on the platform in general. There are some exceptions (the JSON and XML parsers can handle them), but they must not appear in general code nor in queries (regular or dynamic) unless they're contained in a string literal (e.g. WHERE MyTextField__c = 'Mr. MacDonald, "Mayor" of Hooverville').

Replace those double quotes with escaped single quotes, i.e. \', and that error should disappear.

The next issue you'd run into is trying to bind system.now().addHours(-2). Dynamic queries can only handle simple variable binds. Bring that calculation out of your query, into its own variable, and then bind just that variable.

The double quotes are what the error is complaining about, though it is hard to see the double quote in '"' in the error message. The double quotes appear in Where Profile_Name__c ="Portal JIT User".

Dobule quotes shouldn't be used on the platform in general. There are some exceptions (the JSON and XML parsers can handle them), but they must not appear in general code nor in queries (regular or dynamic).

Replace those double quotes with escaped single quotes, i.e. \', and that error should disappear.

The next issue you'd run into is trying to bind system.now().addHours(-2). Dynamic queries can only handle simple variable binds. Bring that calculation out of your query, into its own variable, and then bind just that variable.

The double quotes are what the error is complaining about, though it is hard to see the double quote in '"' in the error message. The double quotes appear in Where Profile_Name__c ="Portal JIT User".

Dobule quotes shouldn't be used on the platform in general. There are some exceptions (the JSON and XML parsers can handle them), but they must not appear in general code nor in queries (regular or dynamic) unless they're contained in a string literal (e.g. WHERE MyTextField__c = 'Mr. MacDonald, "Mayor" of Hooverville').

Replace those double quotes with escaped single quotes, i.e. \', and that error should disappear.

The next issue you'd run into is trying to bind system.now().addHours(-2). Dynamic queries can only handle simple variable binds. Bring that calculation out of your query, into its own variable, and then bind just that variable.

added 225 characters in body
Source Link
Derek F
  • 64.1k
  • 15
  • 55
  • 104

The issue is with the double quotes in Where Profile_Name__c ="Portal JIT User". The double quotes are what the error is complaining about, though it is hard to see the double quote in '"' in the error message. The double quotes appear in Where Profile_Name__c ="Portal JIT User".

Dobule quotes shouldn't be used on the platform in general. There are some exceptions (the JSON and XML parsers can handle them), but they must not appear in general code nor in queries (regular or dynamic).

Replace those double quotes with escaped single quotes, i.e. \', and thethat error should disappear.

The next issue you'd run into is trying to bind system.now().addHours(-2). Dynamic queries can only handle simple variable binds. Bring that calculation out of your query, into its own variable, and then bind just that variable.

The issue is with the double quotes in Where Profile_Name__c ="Portal JIT User". The double quotes are what the error is complaining about, though it is hard to see the double quote in '"' in the error message.

Dobule quotes shouldn't be used on the platform in general. There are some exceptions (the JSON and XML parsers can handle them), but they must not appear in general code nor in queries (regular or dynamic).

Replace those double quotes with escaped single quotes, i.e. \', and the error should disappear.

The double quotes are what the error is complaining about, though it is hard to see the double quote in '"' in the error message. The double quotes appear in Where Profile_Name__c ="Portal JIT User".

Dobule quotes shouldn't be used on the platform in general. There are some exceptions (the JSON and XML parsers can handle them), but they must not appear in general code nor in queries (regular or dynamic).

Replace those double quotes with escaped single quotes, i.e. \', and that error should disappear.

The next issue you'd run into is trying to bind system.now().addHours(-2). Dynamic queries can only handle simple variable binds. Bring that calculation out of your query, into its own variable, and then bind just that variable.

Source Link
Derek F
  • 64.1k
  • 15
  • 55
  • 104

The issue is with the double quotes in Where Profile_Name__c ="Portal JIT User". The double quotes are what the error is complaining about, though it is hard to see the double quote in '"' in the error message.

Dobule quotes shouldn't be used on the platform in general. There are some exceptions (the JSON and XML parsers can handle them), but they must not appear in general code nor in queries (regular or dynamic).

Replace those double quotes with escaped single quotes, i.e. \', and the error should disappear.