USP_DATAFORMTEMPLATE_EDITLOAD_EVENTTASKALERTAPPUSERSETTINGS

The load procedure used by the edit dataform template "Event 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.
@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
@EMAILADDRESS UDT_EMAILADDRESS INOUT Send email alerts to

Definition

Copy


CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_EVENTTASKALERTAPPUSERSETTINGS(
    @ID uniqueidentifier,
    @DATALOADED bit = 0 output,
    @TSLONG bigint = 0 output,
    @SENDTASKREMINDERS bit = null output,
    @EMAILADDRESS dbo.UDT_EMAILADDRESS = null output
)
as

    set nocount on;

    declare @TASKALERTTYPEID uniqueidentifier = '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;