USP_DATAFORMTEMPLATE_EDIT_ACTION_ITEM_MESSAGE_TEXT

The save procedure used by the edit dataform template "Action Item Message Text Edit Form".

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN The input ID parameter indicating the ID of the record being edited.
@CHANGEAGENTID uniqueidentifier IN Input parameter indicating the ID of the change agent invoking the procedure.
@ACTIONITEMID uniqueidentifier IN Actionitem
@SUBJECT nvarchar(250) IN Subject
@MESSAGETEXT nvarchar(max) IN Messagetext
@INSTRUCTIONS nvarchar(1000) IN Instructions
@THANKYOUMESSAGETEXT nvarchar(max) IN Thankyoumessagetext
@SENDCOPYTONPO bit IN Sendcopytonpo
@OVERWRITECODE tinyint IN Overwritetype
@PERSONALIZATIONCODE tinyint IN Persoanlizationtype
@EMAILTEMPLATEID int IN Emailtemplateid

Definition

Copy


CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDIT_ACTION_ITEM_MESSAGE_TEXT
(
    @ID uniqueidentifier,
    @CHANGEAGENTID uniqueidentifier = null,
    @ACTIONITEMID uniqueidentifier,
    @SUBJECT nvarchar(250),
    @MESSAGETEXT nvarchar(max),
    @INSTRUCTIONS nvarchar(1000),
    @THANKYOUMESSAGETEXT nvarchar(max),
    @SENDCOPYTONPO bit,
    @OVERWRITECODE tinyint,
--    @THANKYOUEMAILSUBJECT nvarchar(250),

--    @THANKYOUEMAILTEXT nvarchar(max),

    @PERSONALIZATIONCODE tinyint,
  @EMAILTEMPLATEID int
)
as

    set nocount on;

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

    begin try
        -- handle updating the data

        update dbo.ACTIONITEMMESSAGETEXT set
            ACTIONITEMID = @ACTIONITEMID,
            SUBJECT = @SUBJECT,
            MESSAGETEXT = @MESSAGETEXT,
            INSTRUCTIONS = @INSTRUCTIONS,
            THANKYOUMESSAGETEXT = @THANKYOUMESSAGETEXT,
            SENDCOPYTONPO = @SENDCOPYTONPO,
                  OVERWRITECODE = @OVERWRITECODE,
              --    THANKYOUEMAILSUBJECT = @THANKYOUEMAILSUBJECT,

             --     THANKYOUEMAILTEXT = @THANKYOUEMAILTEXT,

                  PERSONALIZATIONCODE = @PERSONALIZATIONCODE,
            EMAILTEMPLATEID = @EMAILTEMPLATEID,

                  CHANGEDBYID = @CHANGEAGENTID,
                  DATECHANGED = getdate()
        where ID = @ID
    end try
    begin catch
        exec dbo.USP_RAISE_ERROR
        return 1
    end catch

return 0;