USP_EVENTTASK_MARKCOMPLETE

Executes the "Event Task: Mark Completed" record operation.

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN Input parameter indicating the ID of the record being updated.
@CHANGEAGENTID uniqueidentifier IN Input parameter indicating the ID of the change agent invoking the update.

Definition

Copy


                    CREATE procedure dbo.USP_EVENTTASK_MARKCOMPLETE
                        (
                            @ID uniqueidentifier,
                            @CHANGEAGENTID uniqueidentifier = null
                        )
                        as
                            set nocount on;

                            if @CHANGEAGENTID is null  
                                exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output;

                            update
                                dbo.EVENTTASK
                            set
                                STATUSCODE = 1,
                                DATECOMPLETED = dbo.UFN_DATE_GETEARLIESTTIME(getdate()), --CR249442-071906 truncating time for task completed date

                                CHANGEDBYID = @CHANGEAGENTID,
                                DATECHANGED = getdate()
                            where
                                EVENTTASK.ID = @ID;

                            return 0;