USP_DATAFORMTEMPLATE_EDITLOAD_PLANITEMTASKALERTAPPUSERSETTINGS

The load procedure used by the edit dataform template "Plan Item Task Alert 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.
@ALERTWHENASSIGNEDTASK bit INOUT Send me an alert when a plan item 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.

Definition

Copy


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

  declare @PLANITEMTASKALERTTYPEID uniqueidentifier;
  set @PLANITEMTASKALERTTYPEID = 'C3C45931-0140-427B-948C-15AF7B39D20E';

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

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

  return 0;
end