function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
P.kumar 27P.kumar 27 

select id , subject ,WhatId,Status,OwnerId,WhoId,Priority, What.Name,ActivityDate,TaskSubtype,Who.Name,Description From Task Where WhatId =:OppId AND Status !='Completed'

Hi All,
Can anyone please help me out , why iam getting error while using this query .
Iam trying to get all tasklist which are related to opportunity
Niraj GananiNiraj Ganani
Check OppId you have defined is of type Id.
I have run the above query in anonymous block it is working fine.

Id oppId = '0062800000DXXXX;

system.debug([select id , subject ,WhatId,Status,OwnerId,WhoId,Priority, What.Name,ActivityDate,TaskSubtype,Who.Name,Description From Task Where WhatId =: oppId AND Status !='Completed']);