USP_DATALIST_OPPORTUNITY_DESIGNATION_GROUP

A datalist of designations for a given opportunity on a constituent group.

Parameters

Parameter Parameter Type Mode Description
@OPPORTUNITYID uniqueidentifier IN Input parameter indicating the context ID for the data list.

Definition

Copy


                CREATE procedure dbo.USP_DATALIST_OPPORTUNITY_DESIGNATION_GROUP(@OPPORTUNITYID uniqueidentifier)
                as begin

                    select 
                        OFP.ID,
                        FP.ID,
                        dbo.UFN_DESIGNATION_BUILDNAME(OFP.DESIGNATIONID) as NAME,
                        OFP.AMOUNT,
                        NF_C.NAME as CONSTITUENTNAME,
                        OFP.BASECURRENCYID
                    from
                        dbo.OPPORTUNITYDESIGNATION OFP
                        inner join dbo.DESIGNATION FP on FP.ID=OFP.DESIGNATIONID
                        outer apply dbo.UFN_CONSTITUENT_DISPLAYNAME(OFP.CONSTITUENTID) NF_C
                    where
                        OFP.OPPORTUNITYID=@OPPORTUNITYID
                    order by
                        OFP.SEQUENCE

                end