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
Rakesh SRakesh S 

ActivityHistories is not displayed in relatedlist of custom page

I have created a VF Page for Patient__c object. Now i want to create record detailpage for Patient__c.

My Page like this:
<apex:page StandardController="Patient__c" extensions="PatientController" >  
    <apex:sectionHeader subtitle="{!Patient__c.Name}" title="Patient" />
<apex:form id="formid" >

----- All entered all out put field with my requirement.-----

 </apex:form> 

    <apex:relatedList list="Appointments__r"/> 
    <apex:relatedList list="ActivityHistories"  />  // which is not displayed in relatedlist.
    <apex:relatedList list="CombinedAttachments"/>
</apex:page>
while creating an object, Allow Activities check box checked. In standard Detail page, Activity History is appeared.

Please any one help me to acheive this problem. i was tried many ways but not working.


Thank you
Rakesh.S
Best Answer chosen by Rakesh S
William TranWilliam Tran
Try to remove the spaces (in case there is a hidden character or something weird) also rearrange them like:

<apex:relatedList list="ActivityHistories"/>
<apex:relatedList list="CombinedAttachments"/>
<apex:relatedList list="Appointments__r"/> 

Thx

All Answers

AmrenderAmrender
Hi Rakesh

ActivityHistories is used to display the Activities which occured in past.
Use OpenActivities to display up-coming Activities
<apex:relatedList list="OpenActivities"  />

Let me know if it helps you.


Regards
Amrender 
Rakesh SRakesh S
Hi Amrender,

It is not working and getting same error like 'OpenActivities' is not a valid child relationship name for entity Patient.
But i need Activity History related list in detail page of record. 

Please help me to solve this problem.

Thank you.
AmrenderAmrender
Just want to make sure if you use this
<apex:relatedList list="ActivityHistories"  />
you are not getting any error but the Activity History related list does not appear on the vf page. Correct me, if I misunderstood it.

If above case is correct, your code looks fine for me. Only possiblity that I could see, check the Profile of the user (who is accessing this page), if he has the proper access to the Task object.

Regards
Amrender 
 
Rakesh SRakesh S
Hi,
<apex:relatedList list="ActivityHistories"  />
I got same error when i insert above code and i also check who is accessing this profile(Admin). 

In Profile-->Object Settings like this..
User-added image
after when i click Task object it looks like
User-added image
Please check it once and help me..

Thank you..
 
Krishna SambarajuKrishna Sambaraju
Hi Rakesh,

You should enable "Allow Activities" when you create the custom object, for the activity history to be displayed. See screenshot below. Edit your custom object and enable the optional feature "Allow Activities". Hope this helps.
Enable Activities on Custom Object Creation
 
Rakesh SRakesh S
Hi Krishna,

I already done with that. In standard Detail page, Activity History is appeared. but in custom page, its not appearing.

Please help me with appropriate solution.

Thank you..

 
Krishna SambarajuKrishna Sambaraju
Hi Rakesh,

It is working for me. Try disabling this flag and re-enable and see if it works, or try this
<apex:relatedList subject="{!Patient__c}" list="ActivityHistories"  />
William TranWilliam Tran
Try to remove the spaces (in case there is a hidden character or something weird) also rearrange them like:

<apex:relatedList list="ActivityHistories"/>
<apex:relatedList list="CombinedAttachments"/>
<apex:relatedList list="Appointments__r"/> 

Thx
This was selected as the best answer
Rakesh SRakesh S
Thank you william. Its working fine.