Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 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\\\'

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.2k users

Browse Categories

...