3

I want id's of tasks related to Opportunity. I tried below in developer console query editor,

select id,createdDate from Task where whatid like '006%'

But its giving me error,

Invalid_Query_Filter_Operator

Its giving description as like operator cannot be used for Id field.

How can i query it from query editor then?

1

2 Answers 2

1

You could try

[SELECT Id 
 FROM Task 
 WHERE WhatId IN  (SELECT Id FROM Opportunity)
]);
0

I think you cannot use comparison operator LIKE with fields of type ID:

The LIKE operator is supported for string fields only.

Read more: Comparison Operators

Instead of LIKE use IN or = opeartors.

0

You must log in to answer this question.

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