5

I am not able to query the customs fields in activity (image below), I can see and query Task and Events, as this objects are called Task and Event, but I cant find the activity one, I have look everywhere in the force.com explorer but no success

enter image description here

2
  • What is the query that you're trying to execute? Commented Jul 25, 2014 at 3:51
  • currently we have a custom object activity__c that was created a few years ago as part of using an app in salesforce as this app wasnt able to interact with the native activity in salesforce. Now where I work are integrating native activities, I am doing a VF page and I need to display all the activities that the current record has, so I am query old activities and I need to check if there are any activities that were saved using a new app, I kno is messy rigth now we will roll over all the old activities, but in the mean time we have to do it this way!
    – manza
    Commented Jul 25, 2014 at 3:55

2 Answers 2

7

you can only run your SOQL queries either on Tasks or Events..

Select Id,YourCustomField__c from Task
Select Id,YourCustomField__c from Event

I believe Activities/Activity is a single logical object type holding both Tasks & Events.. and Tasks and Events are the concrete physical object types that you can run your queries on..

Activities Custom fields is one common place for creating custom fields for both Tasks & Events..

you can also run queries on OpenActivities object related to a particular object (like Lead, Account..)

6
  • well I have tried exactly what you typed but i get an error: INVALID_FIELD: SELECT X1st_Presentation__c FROM Task ^ ERROR at Row:1:Column:8 No such column 'X1st_Presentation__c' on entity 'Task'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
    – manza
    Commented Jul 25, 2014 at 4:08
  • 2
    you will see this error if you don't have access to the field.. can you check the Field Level Security of these fields and see if your profile has access to the field.. Commented Jul 25, 2014 at 4:25
  • I am logged in as the admin, I have modified to true the field level security of that particular field, try both queries and the same result, thanks
    – manza
    Commented Jul 25, 2014 at 4:35
  • If the custom field is in task or in event it should be displayed in any of those objects right? If I create a custom field at the end I can link it to a task or event page layout. this fileds must be stored somewhere
    – manza
    Commented Jul 28, 2014 at 6:28
  • 1
    it seems that I also needed to add in the field level security admin w/Encrypt to work
    – manza
    Commented Jul 31, 2014 at 23:52
0

I tried doing it the other way around, I just need to apply a filter to only show the Personal Object with activities and not all of the records.

SELECT Id, Name, (SELECT Id, Subject FROM Tasks),(SELECT Id, Subject FROM Events), (SELECT Id, Subject FROM ActivityHistories) FROM Personal__c LIMIT 1000

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .