+ Start a Discussion

ProcessInstanceHistory - How to retrieve?

How can you retrieve ProcessInstanceHistory records in an scontrol?  The docs say you can't use query but need to use the describeobject call which returns a query result for each processinstance.  When I try this it doesn't seem to work, all I can see are fields and the normal describe metadata info... How can I retrieve history records using the line
var dso = sforce.connection.describeSObject("ProcessInstanceHistory");

Message Edited by gsickal on 08-22-2007 04:51 PM

I use this query to build the process history:

Select o.Id, (Select Id, Status From ProcessInstances), (Select ActorId, Comments, CreatedById, CreatedDate, Id, IsPending, OriginalActorId, RemindersSent, StepStatus From ProcessSteps) from Opportunity o where Id = '<RECORD ID>'

I believe the inner ProcessSteps query will give you what you need.

Hope this helps.