Kronos888
Kronos888

Reputation: 1

Microsoft CRM 2016: Trying to query the asyncoperation entity through sdk / SQL. Not able to see the Workflowstate field

I've been trying to troubleshoot some failed workflow issues. One of the things I'm doing is querying the asyncoperation entity through the sdk.

When I view the Data field of an AsyncOperation record I can see the xml representation of AsyncOperationData. This is great!

However when I try to view the WorkflowState field of the AsyncOperation through the sdk, I always get a NULL back, even though I can verify that it's non-null through a sql query.

1) Has anyone encountered this issue before?

2) Does anyone know how to read the unencrypted versions of the following fields from this sql query:

SELECT ao.Data, ao.WorkflowState FROM dbo.AsyncOperation ao

Upvotes: 0

Views: 835

Answers (1)

Matt Dearing
Matt Dearing

Reputation: 9386

That field is not queryable via the API. If you add it to a fetch query or query expression you'll get back the error:

Retrieve can only return columns that are valid for read. Column : workflowstate. Entity : asyncoperation

Similarly if you write a metadata query for asyncoperation and look at the IsValidForRead property of workflowstate it is false. Assuming you're using a custom workflow activity perhaps you could add some logging to it and check those to help debug.

Upvotes: 3

Related Questions