You need to sign in to do that
Don't have an account?
SOQL query for fetching all tasks whose WhatId is pointing to a Opportunity
Task->WhatId field is a reference to field pointing to either Account / Case / Opportunity / ..... Now i need to get all tasks whose WhatId is pointing to a Opportunity ,
Now the SOQL query that can be used for retrieval of same would be as follows
Option1
select Id,WhatId from Task where WhatId like '006%' - but this query returns error because like operator can be used only for string comparison and WhatId is a field of type ID
Option2
select Id,WhatId from Task where WhatId = '006%' - but this query returns no records as % is not treated to be wild char. Would like to know work around for getting all tasks having whatid pointing to a Opportunity ,
NOTE : - 006 is starting 3 chars of any opportunity sfdc ID
Hope this helps...
All Answers
Hope this helps...
Message Edited by TCS CRMOnDemand on 12-13-2007 05:59 AM