function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NinjaMagicianNinjaMagician 

Can a SOQL query gather WorkOrder and WorkOrderLineItems?

From preliminary tests, it doesn't seem possible to query the new work order objects. These don't list in the Standard and Custom Objects breakdown within Workbench. If I try a simple query such as SELECT Id FROM WorkOrder, it gives an error stating that sObject type is not supported. 

Is there any way to use SOQL to gather work order information?
pconpcon
I don't see anywhere that Salesforce offers native WorkOrder support.  Are you using some sort of AppExchange / custom objects to provide this functionality?
NinjaMagicianNinjaMagician
Hi pcon,

I think I was able to get to the bottom of the issue. The new Work Order object that is available in Spring '16 can only be queried using api version 36 or greater. When using Workbench, the highest version available is 35, which is why the objects don't show. 

 
pconpcon
That makes sense.  It turns out you have to enable it before the objects show up.  I was using the metadata browser [1] but I did not have it enabled in my org so the objects did not show up for me.  You might have better luck using the developer console over Workbench to do this query (at least until Workbench is updated to api v36).

[1] https://developer.salesforce.com/blogs/developer-relations/2015/02/using-metadata-api-describe-objects.html