Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in Salesforce by (11.9k points)

I'm trying to get my Escape characters to work in Force.com explorer.

This is exactly what the data looks like in Salesforce,

Awaiting Custodian Data - Pending '8'

I need to filter in on this data with a query statement like this,

Where policy__r.Policy_Status__c = 'Awaiting Custodian Data - Pending '8''

Here is what I have tried but I cannot get to work,

'Awaiting Custodian Data - Pending \'8\''

'Awaiting Custodian Data - Pending ''8'''

'Awaiting Custodian Data - Pending \'\8\'\'

'Awaiting Custodian Data - Pending '8''

"Awaiting Custodian Data - Pending \'8\'"

I can't figure out what's not working here, anyone got an idea?

1 Answer

0 votes
by (32.1k points)

If you're building a string in apex, so, \' is an escape sequence so you would need to escape that do something like \\\'8\\\'

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...