I have been using the below SOQL to get the Notes and Attachments that have been added to a record in my Custom Object Request_For_System_Change (alongside all the other fields I need, the below is shortened)
, recordType.name, Name
, (SELECT Id, Name, ContentType, OwnerId, CreatedDate FROM Attachments)
, (SELECT Id, Title, CreatedDate, createdbyid, body FROM Notes)
FROM Request_for_System_Change__c where Id = :recordId ];
Then I have been using two tables in my VF page to display the Notes and Attachments as below:
Now my manager has pointed out that in order to see the history really we need all the attachments and notes together in one table in descending date order like they are in the standard SalesForce page:
So how could I get all those records together in one SOQL query which I can then in one table?