USP_DATAFORMTEMPLATE_VIEW_REVENUEPOSTED

The load procedure used by the view dataform template "Revenue Posted View Form"

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN The input ID parameter used to load the fields defined on the form.
@DATALOADED bit INOUT Output parameter indicating whether or not data was actually loaded.
@ISPOSTED bit INOUT Is posted

Definition

Copy


                create procedure dbo.USP_DATAFORMTEMPLATE_VIEW_REVENUEPOSTED
                (
                    @ID uniqueidentifier,
                    @DATALOADED bit = 0 output,
                    @ISPOSTED bit = null output
                )
                as
                    set nocount on;

                    -- be sure to set this, in case the select returns no rows

                    set @DATALOADED = 0;
                    select @DATALOADED = 1,
                           @ISPOSTED = case when REVENUEPOSTED.ID is null then 0 else 1 end
                    from dbo.REVENUE
                    left join dbo.REVENUEPOSTED on REVENUEPOSTED.ID = REVENUE.ID
                    where REVENUE.ID = @ID

                    return 0;