Public Class ClassWorkflow
    Public Shared Sub Refresh_Workflows_Entity()
        Dim sql = String.Format("SELECT WF_TASK_ID, WF_ID, dbo.FNPMO_GETOBJECTCAPTION('{0}', 'TASK_TITLE' + CONVERT(VARCHAR(5), WF_ID), 1) AS WF_TITLE, RECORD_ID, STATE_ID, " & _
                         "dbo.FNPMO_GETOBJECTCAPTION('{0}', 'WF_STATE_TITLE' + CONVERT(VARCHAR(5), STATE_ID), 1) AS STATE_TITLE, FORM_VIEW_ID, ENTITY_ID, " & _
                         "dbo.FNPMO_GETOBJECTCAPTION('{0}', 'FORMVIEW_TITLE' + CONVERT(VARCHAR(5), FORM_VIEW_ID), 1) AS 'ENTITY_TITLE', COMMENT, DUE_DATE, ADDED_WHEN, CHANGED_WHO, CHANGED_WHEN, TASK_DATE, FINAL, COLOR, " & _
                         "'{1}' AS USERNAME, dbo.FNPMO_GET_ENTITY_COLUMN_CONTENT(RECORD_ID) AS RECORD_DESCRIPTION, DESCRIPTION, RECORD_DESCRIPTION AS Expr1, FINISHED, MANUALLY, " & _
                            "CREATE_ON_REC_CREATE, CREATE_ON_FOLL_UP FROM VWPMO_WF_ACTIVE AS T", USER_LANGUAGE, USER_USERNAME)
        CURRENT_VWPMO_WF_ACTIVE = ClassDatabase.Return_Datatable(sql, True)
    End Sub
 
End Class
