About this question
I have made two tables, service order and status history (child table). I want to find all the service orders which have a status history record matching ‘Order Complete.’ I have used some queries. But I am getting the error ‘unknown error parsing query.’
SELECT Id, Name, CreatedDate, (SELECT Name FROM Status_History__r ORDER BY CreatedDate DESC LIMIT 1)
FROM Service_Order__c
WHERE id = (SELECT id FROM Status_History__r WHERE Name = 'Order Completed')
If I use a new query using SOQL, I am also getting an error that shows that ‘Order Error at Row:3:Column:29 subject type ‘Status_History_r’ is not supported. It also says that I must append the ‘_c’ to use a custom object and asks me to reference the WSDL for an accurate name.