You need to sign in to do that
Don't have an account?

apex:relatedList - how to specify a list that uses a mapping custom object?
I use a custom object that I am using to map the following two fields, let's call this mapping custom object "EFMAP":
field 1: a master-detail relationship with a custom object called "sentity"
field 2: a lookup relationship with a custom object called "sfield"
For sfield's view page, I want to have a related list to the "sentity" objects that it maps to.
I've been trying different things, and I keep getting errors about the relationship being wrong.
Can anyone provide any insight into how I should specify this in my apex page?
<apex:relatedList list="???"/>
I built a similar page using Setup, and in the layout XML, it states
<relatedLists>
<fields>OBJECT_ID</fields>
<fields>sentity__c</fields>
<relatedList>EFMAP.sfield__c</relatedList>
</relatedLists>
<fields>OBJECT_ID</fields>
<fields>sentity__c</fields>
<relatedList>EFMAP.sfield__c</relatedList>
</relatedLists>
The ChildRelationship name should be set automatically when you create the relationship but there has been a hard to kill bug with that. Whenever you define a lookup or master-detail relationship always assure the child relationship name is set to avoid future issues.