Skip to main content
added 1 character in body
Source Link
sfdcfox
  • 501.7k
  • 21
  • 473
  • 828

You don't need to escape the characters if you simply use a binding statement:

searchWhere = 'Client_Last_Name__c = :preEscape';

For sake of argument, if you did need to escape it, check for a null value first:

if(preEscape != null) {
    searchWheresearchString = String.escapeSingleQuotes(preEscape);
}

You don't need to escape the characters if you simply use a binding statement:

searchWhere = 'Client_Last_Name__c = :preEscape';

For sake of argument, if you did need to escape it, check for a null value first:

if(preEscape != null) {
    searchWhere = String.escapeSingleQuotes(preEscape);
}

You don't need to escape the characters if you simply use a binding statement:

searchWhere = 'Client_Last_Name__c = :preEscape';

For sake of argument, if you did need to escape it, check for a null value first:

if(preEscape != null) {
    searchString = String.escapeSingleQuotes(preEscape);
}
Source Link
sfdcfox
  • 501.7k
  • 21
  • 473
  • 828

You don't need to escape the characters if you simply use a binding statement:

searchWhere = 'Client_Last_Name__c = :preEscape';

For sake of argument, if you did need to escape it, check for a null value first:

if(preEscape != null) {
    searchWhere = String.escapeSingleQuotes(preEscape);
}