You need to sign in to do that
Don't have an account?
snippets@sf
How can i get details of related to ie the WhatId of Task Object in SOQL.
Hi,
How can i get details of related to ie the WhatId of Task Object in SOQL.
CustomObject has a field as Name
Example : Task t1 is related to CustomObject
SOQLQuery could be [SELECT id,whatid from Task];
This will result me in taskid and the customObject record id but what if i need that complete record of customObject.
Appriciate any inputs on this in advance
Thanks.
If I am correct Task is child and custom object is your parent.Then,the query should be like
select id,whatId,what.name,what.<custom object field API name>/ from Task
here,what.name > Name of custom object record.
what.<custom object field API name> > You can use any field of custom object to query here.
You could do something like below:
Let me know if that helps.
Regards,
Lakshman
Why not use this new feature - SOQL Polymorphism
This should make your job a lot easier!
SOQL Polymorphism is the key to go ahead in terms of accessing specific fields or filtering records based on related types.
For a sneak peek on polymorphic keys you can visit http://mightycoder.blogspot.in/2013/06/sneak-peak-salesforce-polymorphic-keys.html