USP_DATALIST_DESIGNATIONLEVEL

A datalist of all Fundraising Purpose records.

Parameters

Parameter Parameter Type Mode Description
@CURRENTAPPUSERID uniqueidentifier IN Input parameter indicating the ID of the current user.

Definition

Copy


                CREATE procedure dbo.USP_DATALIST_DESIGNATIONLEVEL(@CURRENTAPPUSERID uniqueidentifier = null)
                as                 
                    set nocount on;

                    /*
                        List of all DesignationLevel1's that have designations defined
                    */
                    select LEVEL.ID, LEVEL.NAME, 
                    case (select count(ID) from dbo.DESIGNATION where DESIGNATIONLEVEL1ID = LEVEL.ID and (PROJECTCODE = '' or ACCOUNTNUMBER = ''))
                        when 0 then '' else 'RES:warning' end
                    from dbo.DESIGNATIONLEVEL LEVEL
                    where exists (select ID from dbo.DESIGNATION where DESIGNATION.DESIGNATIONLEVEL1ID = LEVEL.ID)
                        and dbo.UFN_SITEALLOWEDFORUSER(@CURRENTAPPUSERID, LEVEL.SITEID)=1
                    order by LEVEL.NAME;