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
neao18neao18 

How to get all the columns from polymorphic Soql!

Hi All,

I have goen through the doc on polymorphic Soql and it says that what ever I write in after typeof fieldlist will be returnded but when I use this :

 

[Select Id, Description, ActivityDate, TYPEOF Who
WHEN Lead THEN Email WHEN Contact THEN Email END from Task]

 

It only retrun the Id, Description, ActivityDate columns and not the Email one??

 

I have refered this post : http://blogs.developerforce.com/tech-pubs/2012/09/soql-polymorphism-or-how-i-learned-to-love-the-polymorphic-relationship.html

 

Note: I have SOQL Polymophism enabled.

souvik9086souvik9086

You should able to get the Email column as well. The query is correct, Whats the problem coming?

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks