UFN_BATCHTEMPLATE_ALLOWSIMPORT

Returns a bit value indicating whether the batch template allows data to be imported into it via the import business process.

Return

Return Type
bit

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN

Definition

Copy


CREATE function dbo.UFN_BATCHTEMPLATE_ALLOWSIMPORT(@ID uniqueidentifier)
returns bit
as
begin

    declare @RETURNVALUE bit;

    select @RETURNVALUE = case when (BATCHTYPECATALOG.ALLOWIMPORT = 1 and (BATCHTEMPLATE.TEMPLATEUSECODE in (0, 2))) then 1 else 0 end
  from dbo.BATCHTEMPLATE
    left join dbo.BATCHTYPECATALOG on BATCHTEMPLATE.BATCHTYPECATALOGID = BATCHTYPECATALOG.ID
    where BATCHTEMPLATE.ID = @ID;

    return @RETURNVALUE;

end;