'Sales__r' is not a valid child relationship name for entity Object(Sales__c)
Technical Issue:
We are facing an error on Custom page time of loading and error is “'Sale_Comments__r' is not a valid child relationship name for entity Sale. This error comes only for Standard Sales User profiles.
Description:
We have analyzed the issue and error comes from related list of child object. We are populating the related list in this page.
Code line of related list is : <apex:relatedList list="Sales_Comments__r">.
Analysis:
Given below points for analysis of Parent Child relation ship:
- Parent object is Sales__c and child object is Comment__c.
- on Comment__c object Request_Id__c field is Master-Detail and visible to all profiles and API name of child relation ship is Sales_Comments__r.
- Checks Standard Sales User profile FLS (Field Level Security) of both object. Where Parent object giving R/C/E access and Child object giving R/C access.
- Checks active users of above profiles Territory, User Group etc.
- Login with user and run the visual force page but it shows above error.
Visual force Code:
<apex:page standardController="Salest__c">
<apex:relatedList list="Sales_Comments__r" />
</apex:page>
Solution:
Login with Profiles active user and follow below steps:
- Run the URL like https://intanceof.com/a1eQ0000000b0EcIAI?nooverride=1
- Above URL contains instance of sales force and Id of record. Where no override is used to display the override related list.
- Kindly check there is Comment related list available or not.
- If not available than Click on Customized Page and add related list.
- Run the /apex/output?id=record_Id and now you will get output page.
Conclusion:
Use the no override word in URL and checks there is related list available or not.
0 Comments