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
ManzaManza 

where the activity custom fields are stored?

I have a group of custom activity fields, however I cant find them in either Task or Event, so I am wondering if they are stored some where else?
If i try to query on Force.com explorer:

SELECT  id, custom_field__c FROM EVENT
or
SELECT  id, custom_field__c FROM TASK

No such column on entity task or event
Best Answer chosen by Manza
srlawr uksrlawr uk
yep, I can totally confirm that is how they work.

I queried my Task object in the developer console for a field that did not exist..

none


I then went to customise, created a custom activity field, with default security settings

field

literally tabbed back to the developer console and hit execute, and it loaded all my Task data (with no values for this field, of course, but the column there) no problem :)

worked!


Hopefully this proof will spur you on to the source of your problem! I would suggest cached, or incorrectly synced meta data is at play somewhere.

All Answers

logontokartiklogontokartik
They are stored in Activity Custom Fields. Please see screenshot.User-added image
ManzaManza
Hi Thank you for your reply, yes I know they are there, that is how you create it them, but my question is how do you query them in a controller or in force.com explorer, as I cant query them on event or task object.
ManzaManza
In other words what is the name of that object
logontokartiklogontokartik
Have you checked the security on the custom field, because that field should be available on both Task and Event objects
alibzafaralibzafar
It is availble on both Task and Events, so for instance if you have a Activity Custom Field Department__c . You can query it through both of them. 

Task t = [Select Department__c from Task];

Event e = [Select Department__c from Event];

  
alibzafaralibzafar
@Manza If you are unable to see new Custom Field just check if you have refereshed your Database schema in Force.com Explorer 
srlawr uksrlawr uk
yep, I can totally confirm that is how they work.

I queried my Task object in the developer console for a field that did not exist..

none


I then went to customise, created a custom activity field, with default security settings

field

literally tabbed back to the developer console and hit execute, and it loaded all my Task data (with no values for this field, of course, but the column there) no problem :)

worked!


Hopefully this proof will spur you on to the source of your problem! I would suggest cached, or incorrectly synced meta data is at play somewhere.
This was selected as the best answer