I tried to create a table based on a model of the ActivityHistory object, but I get this error when I try to view the page:
1. An error occurred while attempting to perform the following SOQL query: SELECT Id,ActivityType,IsTask,Subject,Status,Priority,Location,ActivityDate,Description,Owner.Name,OwnerId FROM ActivityHistory WHERE ((WhatId = ‘a0Gd000000GApaJEAT’)) ORDER BY LastModifiedDate DESC LIMIT 101 Error:entity type ActivityHistory does not support query
The ActivityHistory and OpenActivity objects are actually available for use in Skuid (or in any Visualforce custom development) – Salesforce exposes them via the API, but they cannot actually be used except for within Salesforce internal code. Instead, do separate queries on the Task or Event objects. To just get Open Tasks, add an “IsClosed != true” condition, or to get just Completed Tasks, do a Condition with “IsClosed != false”. (I think that in a future release of Skuid we may make it so that these objects don’t show up in the list of possibilities, since they don’t support querying or any of the CRUD operations).
Also, I’m currently working on a tutorial for making an “Activities Tab” that will include the Open Tasks and Closed Tasks related lists and some nifty JS snippets (thanks Zach) to mark tasks completed & view the full conversation without leaving the page Hopefully it’ll get published next week.
I’m having similar issues with trying to load ActivityHistory for a Contact. I’m able to bring in the records as a child relationship under my Contact, but I can’t display these records as rows on a table. Any help with this would be appreciated, thanks!
I think you’ve gotten about as far as you’re able to. Querying the “ActivityHistories” Child Relationship is the best way / only way to get at ActivityHistory data, but Skuid doesn’t let you display Child Relationship data as rows in a Table, so your best bet is to use a Template Component to format the data using Merge Syntax to “look” like a table. This is a bit of a hack, that may not look good in the future if Skuid changes its CSS, but it’s a temporary workaround.
Thanks Zach, this was perfect! I didn’t think of using templates for this, that was a great idea. In case anyone tries something like this in the future, make sure you include AcitvityHistories as a child relationship in your model, and set Properties > Fields to Order Records By to “ActivityDate DESC NULLS LAST, LastModifiedDate DESC”, otherwise you’ll get an error.