USP_SIMPLEDATALIST_BATCHTEMPLATEBYUSER
A list of all Batch Templates available for the current user
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. |
@ISFORWEBSHELL | bit | IN |
Definition
Copy
CREATE procedure dbo.USP_SIMPLEDATALIST_BATCHTEMPLATEBYUSER
(
@CURRENTAPPUSERID uniqueidentifier,
@ISFORWEBSHELL bit = 0
)
as
select distinct BATCHTEMPLATE.ID as VALUE, BATCHTEMPLATE.NAME as LABEL
from dbo.BATCHTEMPLATE
left join dbo.BATCHTYPECATALOG on BATCHTEMPLATE.BATCHTYPECATALOGID = BATCHTYPECATALOG.ID
where
dbo.UFN_SECURITY_APPUSER_GRANTED_BATCHPROCESSOR(@CURRENTAPPUSERID, BATCHTEMPLATE.ID) = 1
and BATCHTEMPLATE.CUSTOM = 0
and BATCHTEMPLATE.ACTIVE = 1
and BATCHTEMPLATE.TEMPLATEUSECODE in (0,1)
and 1 = dbo.UFN_INSTALLEDPRODUCTS_OPTIONALPRODUCTSINSTALLED
(
BATCHTYPECATALOG.SPECXML.query
(
'declare namespace common="bb_appfx_commontypes";
/*/common:InstalledProductList'
)
)
and
(
isnull(@ISFORWEBSHELL, 0) = 0
--Exclude batch types that have handlers but no web shell conversion when the list is loaded for web shell
or 0 = BATCHTYPECATALOG.SPECXML.value
(
'declare namespace batch="bb_appfx_batchtype";
empty(/batch:BatchTypeSpec/batch:WebEventHandlers/batch:BatchEventHandler)
and not(empty(/batch:BatchTypeSpec/batch:EventHandlers/batch:BatchEventHandler))',
'bit'
)
)
order by BATCHTEMPLATE.NAME;