1

Is it possible to search multiple fields?

I am using the query:

$search = 'FIND {'.$email.'} IN EMAIL FIELDS RETURNING CONTACT(ID)';
$response = $mySforceConnection->search($search);

I would like to do something like this:

$search = 'FIND {'.$email.', '.$firstname.'} IN EMAIL,NAME FIELDS RETURNING CONTACT(ID)';
$response = $mySforceConnection->search($search);

Is that possible?

1 Answer 1

1

You may be able to apply a SOSL where condition if you had an exact email match. But I don't think the Find {SearchQuery} will span fields.

Otherwise you might find a directly SOQL search to be an easier approach if you know you are just searching for the email address and name.

2
  • So I can basically add the condition in the WHERE clause?
    – odedta
    Commented Jul 13, 2017 at 8:26
  • 1
    @odedta Yes, a standard SOQL where clause can handle these conditions. Commented Jul 13, 2017 at 23:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .