0

I have a SOAP connection to SFDC in PHP and I have a query that looks like this:

$query2 = " Select Name, StartDate from Campaign where Id in (7016F0000025iaJ, 7016F0000025iZV, 7016F000001PvKf)";

But I get the following error:

MALFORMED_QUERY: StartDate from Campaign where Id in (7016F0000025iaJ, 7016F0000025iZV, ^ ERROR at Row:1:Column:54 expecting a right parentheses, found 'F0000025iaJ'

I have a list of IDs that I want to query against. What error am I making with my syntax?

2 Answers 2

1

You need to wrap the ids in single quotes.

WHERE Id IN ('701...', '701...', 'etc.')
0
3

When you have a specific list of ID values, consider using retrieve() instead:

$result = $client->retrieve('Id,Name,StartDate,...','Campaign',array($id1,$id2,...));

(note: code above is an example and not meant to be taken literally.)

0

You must log in to answer this question.

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