USP_DATAFORMTEMPLATE_VIEW_REVENUELOCKBOX
The load procedure used by the view dataform template "Revenue Lockbox 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. |
@LOCKBOXNAME | nvarchar(100) | INOUT | Lockbox |
@BATCHNUMBER | nvarchar(100) | INOUT | Batch number |
@BATCHSEQUENCE | int | INOUT | Batch sequence |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_REVENUELOCKBOX
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@LOCKBOXNAME nvarchar(100) = null output,
@BATCHNUMBER nvarchar(100) = null output,
@BATCHSEQUENCE int = null output
)
as
set nocount on;
set @DATALOADED = 0;
select @DATALOADED = 1,
@LOCKBOXNAME = LOCKBOX.NAME,
@BATCHNUMBER = BATCHNUMBER,
@BATCHSEQUENCE = BATCHSEQUENCE
from dbo.REVENUELOCKBOX
left join dbo.LOCKBOX
on REVENUELOCKBOX.LOCKBOXID = LOCKBOX.ID
where REVENUELOCKBOX.ID = @ID
--we need to specify dataloaded to true if there is a record in revenue table but not yet in
--revenuelockbox table
select
@DATALOADED = 1
from dbo.REVENUE
where
ID = @ID
return 0;