USP_DATAFORMTEMPLATE_EDITLOAD_REVENUELOCKBOX

The load procedure used by the edit dataform template "Revenue Lockbox Edit 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.
@TSLONG bigint INOUT Output parameter indicating the TSLONG value of the record being edited. This is used to manage multi-user concurrency issues when multiple users access the same record.
@LOCKBOXID uniqueidentifier INOUT Lockbox
@BATCHNUMBER nvarchar(100) INOUT Batch number
@BATCHSEQUENCE int INOUT Batch sequence

Definition

Copy


                    CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_REVENUELOCKBOX(
                        @ID uniqueidentifier,
                        @DATALOADED bit = 0 output,
                        @TSLONG bigint = 0 output,
                        @LOCKBOXID uniqueidentifier = null output,
                        @BATCHNUMBER nvarchar(100) = null output,
                        @BATCHSEQUENCE int = null output
                    )
                    as

                        set nocount on;

                        set @DATALOADED = 0
                        set @TSLONG = 0

                        select
                            @DATALOADED = 1,
                            @TSLONG = TSLONG,
                            @LOCKBOXID = LOCKBOXID,
                            @BATCHNUMBER = BATCHNUMBER,
                            @BATCHSEQUENCE = BATCHSEQUENCE    
                        from dbo.REVENUELOCKBOX
                        where ID = @ID

                        --we need to specify dataloaded to true if there is a record in revenue table but not yet in

                        --revenuelockbox table so we can create it in the save

                        select
                            @DATALOADED = 1
                        from dbo.REVENUE
                        where
                            ID = @ID

                        return 0;