Monday, July 5, 2021

Workflow last comment

  display public server  WorkflowComment  workflowLastComment()

    {

        WorkflowTrackingTable           workflowTrackingTable;

        WorkflowTrackingStatusTable     workflowTrackingStatusTable;

        WorkflowTrackingCommentTable    workflowTrackingCommentTable;


        select firstonly ContextCompanyId, ContextTableId, ContextRecId from workflowTrackingStatusTable

            where workflowTrackingStatusTable.ContextCompanyId    == curext()

               && workflowTrackingStatusTable.ContextTableId      == this.TableId

               && workflowTrackingStatusTable.ContextRecId        == this.RecId

            join firstonly TrackingId, CreatedDateTime from workflowTrackingTable order by CreatedDateTime desc

                where workflowTrackingTable.WorkflowTrackingStatusTable == workflowTrackingStatusTable.RecId

            join Comment from workflowTrackingCommentTable

                where workflowTrackingCommentTable.WorkflowTrackingTable == workflowTrackingTable.RecId;


        return workflowTrackingCommentTable.Comment;

    }

No comments:

Post a Comment