I am using standard controller of a custom object called Enagements__c to display details of the record in VF Page. I want to use the standard feature of '<apex:relatedlist
' and display all the related list for that object.
I am not able to display the history tracking section and giving a strange error, even though i give the child relationship name correctly it still gives me a error.
<apex:relatedList list="Engagements__history"/>
Error i get when see the output is :
'Engagements__history' is not a valid child relationship name for entity Engagements
I am confused since when query the history tracking from SOQL it works fine which shows that relationship name is correct
SELECT Id, customfield__c, (SELECT OldValue, NewValue FROM Enagements__history) FROM Engagements__c
How do we get the history tracking relatedlist of a customobject to use
<apex:relatedList list="Engagements__history"/>
Engagements__Histories
.Schema.DescribeFieldResult f = Schema.sObjectType.Order_Line_Item__c.fields.Order__c; System.debug(f.getRelationshipName());
check this post salesforce.stackexchange.com/questions/23498/…