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
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.