I've been reading up on queries via the API. This post here on histories from custom objects and how to make sub-queries have been very useful.
I'm doing blind iterations through the schema - ie, the code I write needs to grab data on any object and be robust as we add new ones.
Currently it all works but isn't grabbing histories - I figure that's because I need to ask it to query the My_Custom_Object__History from each My_Custom_Object__c. Ideally though, I want an insight into if a record has a history before I fire my request.
I was looking through the rest explorer to see if there was a Has_history:true or Historible:true kind of parameter on object describe (everything there seems to end in -able!).
If I could find some indicator I could do something like:
@s_object.get_history if @s_object.has_history and save myself futile queries and error handling.
Then... assuming Histories is a common name across all objects I could just poll Select Id, Name, (Select Id From Histories) From Custom_Object__c
Worst case I guess I just have to do the above line and then ignore if nil/null
Anyone done anything similar or got any insight?
¯\_(ツ)_/¯. Cheers! – Huw Jul 29 '16 at 14:16