USP_SIMPLEDATALIST_INTERACTIONSUBCATEGORY

This simple datalist returns all the active sub categories for a given interaction category.

Parameters

Parameter Parameter Type Mode Description
@INCLUDEINACTIVE bit IN Include inactive
@INTERACTIONCATEGORYID uniqueidentifier IN INTERACTIONCATEGORYID

Definition

Copy


            CREATE procedure dbo.USP_SIMPLEDATALIST_INTERACTIONSUBCATEGORY(@INCLUDEINACTIVE bit = 0, @INTERACTIONCATEGORYID uniqueidentifier = null)
            as
                set nocount on;

                select 
                    ISC.ID as VALUE,
                    ISC.NAME as LABEL
                from
                    dbo.INTERACTIONSUBCATEGORY as ISC
                    inner join dbo.INTERACTIONCATEGORY as IC on ISC.INTERACTIONCATEGORYID = IC.ID
                where (ISC.INTERACTIONCATEGORYID = @INTERACTIONCATEGORYID or @INTERACTIONCATEGORYID is null)
                        and ((ISC.ISINACTIVE = 0 and IC.ISINACTIVE = 0) or @INCLUDEINACTIVE=1)
                order by
                    case IC.SORTMETHODCODE when 1 then ISC.SEQUENCE else 0 end,
                    ISC.NAME;