USP_DATAFORMTEMPLATE_EDITLOAD_APPEALMAILINGTASKALERTAPPUSERSETTINGS

The load procedure used by the edit dataform template "Appeal Mailing Task Application User Settings Edit Form"

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN The input ID parameter used to load the fields defined on the form.
@ALERTWHENTASKASSIGNED bit INOUT Send me an alert when a task has been assigned to me
@EMAILADDRESS UDT_EMAILADDRESS INOUT Send email alerts to
@DATALOADED bit INOUT Output parameter indicating whether or not data was actually loaded.
@TSLONG bigint INOUT Output parameter indicating the TSLONG value of the record being edited. This is used to manage multi-user concurrency issues when multiple users access the same record.
@SENDTASKREMINDERS bit INOUT Send me an alert for task reminders

Definition

Copy


CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_APPEALMAILINGTASKALERTAPPUSERSETTINGS
(
    @ID uniqueidentifier,
    @ALERTWHENTASKASSIGNED bit = null output,
    @EMAILADDRESS dbo.UDT_EMAILADDRESS = null output,
    @DATALOADED bit = 0 output,
    @TSLONG bigint = 0 output,
    @SENDTASKREMINDERS bit = null output
)
as
    set nocount on;

    declare @TASKALERTTYPEID uniqueidentifier;
    set @TASKALERTTYPEID = '280f5cde-64e5-4713-92f3-d72d1fd291a4';

    if exists (select top(1) ID from dbo.APPUSERALERTTYPESETTING where APPUSERID = @ID and ALERTTYPEID = @TASKALERTTYPEID)            
        select
            @DATALOADED = 1,
            @ALERTWHENTASKASSIGNED = ENABLED,
            @TSLONG = TSLONG
        from
            dbo.APPUSERALERTTYPESETTING
        where
            APPUSERID = @ID
            and ALERTTYPEID = @TASKALERTTYPEID;
    else
        select
            @DATALOADED = 1,
            @ALERTWHENTASKASSIGNED = 0,
            @TSLONG = 0;


    set @TASKALERTTYPEID = '02863BF9-BA85-481E-8AA0-CC60758C6789';

    if exists (select top(1) ID from dbo.APPUSERALERTTYPESETTING where APPUSERID = @ID and ALERTTYPEID = @TASKALERTTYPEID)            
        select
            @DATALOADED = 1,
            @SENDTASKREMINDERS = ENABLED,
            @TSLONG = TSLONG
        from
            dbo.APPUSERALERTTYPESETTING
        where
            APPUSERID = @ID
            and ALERTTYPEID = @TASKALERTTYPEID;
    else
        select
            @DATALOADED = 1,
            @SENDTASKREMINDERS = 0,
            @TSLONG = 0;

    select
        @EMAILADDRESS = EMAILADDRESS
    from
        dbo.APPUSERALERTSETTING
    where
        ID = @ID;

    return 0;