USP_DATAFORMTEMPLATE_VIEW_BackOfficeSystemID

The load procedure used by the view dataform template "Back Office System ID View Data 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.
@IDFOUND bit INOUT Found

Definition

Copy


CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_BackOfficeSystemID
(
    @ID uniqueidentifier,
    @DATALOADED bit = 0 output,
    @IDFOUND bit = null output
)
as
    set nocount on;

    set @DATALOADED = 0;

    select @DATALOADED = 1,
           @IDFOUND = case when exists (
                        select top 1 1
                        from sys.columns as c
                        inner join sys.tables as t on t.object_id = c.object_id
                        where c.name = 'BACKOFFICESYSTEMID'
                        and t.name = (select [TABLENAME] from dbo.[BUSINESSPROCESSOUTPUT] where [ID] = @ID))
                    then -1 else 0 end

    return 0;