You need to sign in to do that
Don't have an account?

Activity History vs. Task
Hello,
I created a Visualforce page for Contacts for looking at a filtered Activity History. I ran into an issue where if I used the object "ActivityHistories", users got an Internal Server error; however, if I changed this to Tasks, the page rendered fine.
Does anyone know the difference here? Looking at the Profile Management screen, I cannot see any specific setting options for Activity History that would explain this.
Below is the page for reference. The line in question is the <apex:repeat> section, where if I change the value to {!Contact.ActivityHistories}, the page renders fine for me (Sys Admin) but not for other users.
Thank you.
<apex:page standardController="Contact"> <apex:pageBlock title="{!contact.name}"> You are viewing the {!contact.name}'s Activity History. <a href='/{!contact.Id}'>Back to Contact Record</a> </apex:pageBlock> <apex:pageBlock title="{!contact.name} Activity History"> <apex:repeat value="{!contact.Tasks}" var="task" > <apex:pageBlockSection title="{!task.Subject} ({!task.ActivityDate})" columns="1" rendered="{!IF(task.WhatId == null, true, false)}"> <apex:outputField value="{!task.Subject}" /> <apex:outputField title="Due Date" value="{!task.ActivityDate}"/> <apex:outputField value="{!task.OwnerId}"/> <apex:outputField value="{!task.LastModifiedDate}"/> <apex:outputField value="{!task.Description}"/> </apex:pageBlockSection> </apex:repeat> </apex:pageBlock> </apex:page>
Not sure what the ActivityHistory table exactly does. You don't need it though, since all completed tasks and events are also available in the corresponding objects.
I did have a look at the access to the ActivityHistory and found out it has NO(?) access at all:
Thanks Hermie, I see the access there.
I guess my curiousity is why the page works under my System Administrator and doesn't error out gracefully under the other accounts (i.e. error message about permissions/access). Displaying the Internal Server Error is less desirable than this.
Hi Andrew,
I'm not sure of the reason, but it may be because of the requirements listed at the bottom of this relevant Web Services API page.
Perhaps the issue is that the user you were testing with did not have "View All Data" permission?
Cheers,
-Philip
After speaking with SF Support, they have advised that the fact that this results as an Internal Server Error (rather than something more graceful), its a bug that will be sent to the QA team.