+ Start a Discussion

SOQL Polymorphisim for custom objects

Hi All,

      Can we use SOQL Polymorphisim for only custom objects with out using standard objects
Hi Chandu,

When I read the following doc related to SOQL Polymorphism  - It reads that its not specific to standard objects as such but did you try using this on a custom object?

Please explain your use case a bit so we can understand the requirement of such feature better..
Thank you for your response

 I tried soql polymorphism with three custom objects  are Ccontact__c,Clead__c,Ctask__c.either a Ccontact__C or a Clead can be the parenet of a Ctask__c.in that which field take as a polymorhic key?
in standard object have same raleationship we are use Whoid field as polymorphic key.


As such, the polymorphic keys cannot be created for custom objects - in your case - Ctask__c behavior is polymorphic but how are you crating this field to lookup to two separate objects Contact and lead?