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
iperez_geniusiperez_genius 

type of task

trying to find the apex code to discover what object a task belongs to

so i create a task for a lead i want to know that the task i access in my code is only a task attributed to elads and not contacts or oppotunities...

can anyone help

ilan
TCAdminTCAdmin
Hello iperez_genius,

I think you will want to use the getSObjectType method on the object. Here is the code from the Apex guide:

Returns the token for this sObject. This method is
primarily used with describe information.
For more information, see Understanding Apex Describe
Information on page 100.
iperez_geniusiperez_genius
are you able to provide me with the actual code