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

Relationships within Customer Portal in Visualforce

I have given the customer portal user rights to 2 custom objects (ParentObject and ChildObject).


Both objects have the "Customer Portal Enabled" checkbox checked.

All the necessary fields in field level security are ticked for the profile.


The page is as follows;


<apex:page standardController="ParentObject" >


        <apex:relatedList list="ChildObjects__r" />




Viewing this page as system admin looks fine.

Viewing this page as a customer portal user returns the following error:

" 'ChildObjects__r' is not a valid child relationship name for entity ParentObject"


Does anyone have any ideas ?




Why are you taking the related List Custom Object as __r .......... try using __c. __r is used to relate to the field of related object.

<apex:page standardController="ParentObject" >


        <apex:relatedList list="ChildObjects__c" />






In my opinion you need to give the portal access to primary contact lookup field to contact in account object and user fields which are necessary to insert a user. Make sure that contact which is associated with account must have a role.


Hope this helps.