You need to sign in to do that
Don't have an account?
'OpenActivities' is not a valid child relationship name for entity [Custom Object Name]
Hi!
I need some help on how to fix this Visualforce Error Message. I want to display the Open Activities and Activity History related list for a Custom Object. In its standard page, by default, this two related list is displayed but when I try to override the view page with a custom visualforce page only the custom child object related list shows.
Here's my code:
<apex:page StandardController="Object__c" extensions="ObjectExtension" showHeader="true" sidebar="true" >
<apex:detail />
<apex:relatedList list="Object_Child__r"/>
<apex:relatedList list="OpenActivities" />
<apex:relatedList list="ActivityHistories"/>
</apex:page>
Is it something about salesforce restrictions? Like, Open Activities and Activity History were standard objects and cannot be a child of a custom object? Is there anyway I can do this right? I really need help T.T
Thanks!
Best Regards,
Pat
Go to > Setup > App Setup > Create > Object > Edit your object > Check "Allow Activities" cehckbox and save
Now try saving your visualforce page.
Thanks
Ankit Arora
Blog | Facebook | Blog Page
I checked all those three items (Allow Reports, Allow Activities, and Track Field History) when I created the object that's why I'm wondering why <apex:relatedList list="OpenActivities"> and <apex:relatedList list="ActivityHistories"> doesn't work in a custom visualforce page but when I try to put subject = "{!Object__c.Account__c}" Open activities and activity history shows up but unfortunately, the record displays on Account object not in my custom Object__c :(
Thanks for a quick reply Ankit!
Hello!
I've tried the codes in my own sandbox here in developer and it works! Yey!
But it still doesn't work in our organization's sandbox so I was wondering if I need to configure something behind the scenes.
Can anyone have an Idea?
Thanks!
Pat
Same code is working for me too. Don't know why your organization is facing this.
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Hi Ankit,
Really appreciate your time :)
Today, I noticed something when I compare my sandbox here in developer force and with our organization.
I don't know if it has a bearing on my concern but when I click in layout properties in our org's sandbox it displays the:
while in developer force sandbox:
Do you have any idea why they are different? They were both custom object and overrides the View with a custom visualforce page.
Thanks!
Pat
I don't think Page Layouts are concerned with your problem. Just make sure that your production and sandbox are in sync. There might be a possibility that some one working on your production org and not done same changes on sandbox.
But setting which I have already mentioned related to object are in picture, may be your sandbox and production is not in sync that is why we are facing this issue.
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Hi Ankit,
Its me again :)
I found the salesforce.schema in Eclipes ForceIDE and tried to open it, look for my custom objet, and see the Child Relationships node.
When I expand it, Open Activity and Activity History is not displayed there so this is one reason why the error tells me that it is not a valid child relationship name for entity myObject.
Do you know some ways on how can I make it a child of my object?
Thanks again!
Pat
Will suggest you to open a case for it, but make sure object settings are as expected. Also that the same thing is working on your sandbox and not in production.
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Are you able to find out where is the problem??
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Nope, not yet.
Will let you know and post the solution here if I were able to solve it so that if someone face the same scenario (though I believe its a rare case haha), there's a solution waiting for them.
Thanks!
Pat
Add a page layout in the standard page layout, and set the related to field of event and task to specific profile, maybe it is wroking.
Nope,. Never found it... the project was postponed but in the new project.. I was able to do it.. wierd. Anyway, thanks for the support Ankit. :)
I'm trying to build a layout with related lists but I wasn't the one who built the custom object. How did you find the different relationships to reference them in the list="???"
There were kinds of ways to see all Child Relationship's Name.
Here's one way I know:
That's all I know :smileyhappy:
Worked perfectly. Thanks
You're welcome!
Thanks for the solution.
It was down to FLS on the Task object ,'Related To' Field... See this FAQ I created.
http://www.improvedapps.com/error-openactivities-valid-child-relationship-name-entity-custom-object-name/