+ Start a Discussion
pat!pat! 

'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

Ankit AroraAnkit Arora

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

pat!pat!

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!

pat!pat!

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

Ankit AroraAnkit Arora

Same code is working for me too. Don't know why your organization is facing this.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

pat!pat!

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:

  • Page Layout Name (Input Text)
  • Tagging (Checkbox) Enable personal tags

while in developer force sandbox:

  • Page Layout Name (Input Text)
  • Highlights Panel (Checkbox) Show in the service cloud console
  • Interaction Log (Checkbox) Show in the service cloud console

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

 

 

 

 

Ankit AroraAnkit Arora

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

pat!pat!

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

Ankit AroraAnkit Arora

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

Ankit AroraAnkit Arora

Are you able to find out where is the problem??

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

pat!pat!

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

Jair ZhengJair Zheng

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.

pat!pat!

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. :)

b-liub-liu

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="???"

pat!pat!

There were kinds of ways to see all Child Relationship's Name.

Here's one way I know:

  • Create a Force.com project in eclipse
  • In the created project, look for the "salesforce.schema" and open it
  • In the schema section, you can see the list of all custom and delivered objects
  • Browse through that list until you find the desired object API name that you were looking for
  • Expand the Object API name then expand the Child Relationships item to see the list of its related object
  • Expand the relationship/related object you want and from there, you can see the Relationship name that you need for the list="<Relationship Name>" attribute

That's all I know :smileyhappy:

b-liub-liu

Worked perfectly. Thanks

pat!pat!

You're welcome!

vish99vish99

Thanks for the solution.

Simon ThompsonSimon Thompson
I just recently had a customer get the same error at the top of this thread with our app!

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/