Workflow step macro

Novice User asked on March 5, 2019 01:49

How to know that what step of workflow the document is in. Is there a macro for it ?

Or a Sql query would be great

Correct Answer

David te Kloese answered on March 5, 2019 10:03

Hi,

Where do you need it for? If it's just to get a quick one-time overview SQL might be easiest. Since the data is stored in multiple columns and tables. You'd have to join the on the CMS_WorkflowStep table. Something like:

select workflow step display name

I just joined everything that is in a workflowstep.

SELECT StepDisplayName, DocumentWorkflowStepID, DocumentID, DocumentNodeID, DocumentName    
FROM cms_document 
JOIN CMS_WorkflowStep ON CMS_Document.DocumentWorkflowStepID = CMS_WorkflowStep.StepID
WHERE DocumentWorkflowStepID IS NOT NULL

Note that documents can be in only 1 step. But a Node can have multiple documents connected with multiple steps. (This is because of different versions, states or even removed). Check my overview for same DocumentNodeID but different DocumentID.

2 votesVote for this answer Unmark Correct answer

Recent Answers


Ilesh Mistry answered on March 5, 2019 10:35 (last edited on March 5, 2019 10:36)

David's provided a nice way to retrieve all your documents via SQL.

There are some none custom ways to also do this, if you want to just see the status of an individual page, you could just go to the page itself --> Properties --> Workflow

Workflow status a single page

Another thing you can do, is use the My Desk Pages widgets to show all pages and then you can see the workflow step they would be in as well.

My desk approach

Another approach is to use the in built Reporting module to help you list out the statutes in a report format - You could even use some of the code from David to help you get a custom report ;)

Kentico Reporting Module

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.