USP_DATAFORMTEMPLATE_VIEW_BATCHPAGEDATA

The load procedure used by the view dataform template "Batch Page View Form"

Parameters

Parameter Parameter Type Mode Description
@CURRENTAPPUSERID uniqueidentifier IN Input parameter indicating the ID of the current user.
@DATALOADED bit INOUT Output parameter indicating whether or not data was actually loaded.
@SHOWBATCHDESIGNADD bit INOUT SHOWBATCHDESIGNADD
@ALERTSENABLED bit INOUT ALERTSENABLED

Definition

Copy


create procedure dbo.USP_DATAFORMTEMPLATE_VIEW_BATCHPAGEDATA
(
    @CURRENTAPPUSERID uniqueidentifier, 
    @DATALOADED bit = 0 output,                    
    @SHOWBATCHDESIGNADD bit = null output,
    @ALERTSENABLED bit = null output
)
as
    set nocount on;
    --since this is just returning whether or not data exists in the system, return 1 whether the data exists or not

    set @DATALOADED = 1;

    if exists (select top 1 ID from dbo.BATCHTYPECATALOG where dbo.UFN_SECURITY_APPUSER_GRANTED_BATCHTYPE(@CURRENTAPPUSERID, BATCHTYPECATALOG.ID) = 1)
        set @SHOWBATCHDESIGNADD = 1
    else
        set @SHOWBATCHDESIGNADD = 0    

    select @ALERTSENABLED = ENABLED from dbo.DATABASEMAILSETTINGS;

    return 0;