I need to run an SOQL that generates activities due next week (for a Conga Composer Solution). Some of the activities are related to Cases. The What.Name for cases is the Case number which has little meaning for our management. IS there a way to return an additional field that is the Case.Subject? I was hoping to use the TypeOf feature, but Salesforce was not willing to enable that for my production org. Below is a snippet of the SOQL that does not yet include the Case.Subject.

SELECT Owner.Name, What.Name, What.Type, WhatId 
where ActivityDate = NEXT_WEEK 
ORDER BY What.Name ASC, ActivityDate DESC

TYPEOF is currently available as a Developer Preview as part of the SOQL Polymorphism feature. For more information on enabling TYPEOF for your organization, contact Salesforce.


So, for the time being you need to perform separate SOQL query to fetch Case Subject based on What.type

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.