USP_DATAFORMTEMPLATE_EDITLOAD_DISBURSEMENTPROCESSTEMPLATE_TRANSACTIONCRITERIA

The load procedure used by the edit dataform template "Disbursement Process Template Transaction Criteria Edit Data 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.
@FILTERCODE tinyint INOUT Filter type
@DUEDATENUMBEROFDAYS int INOUT Number of days after
@DUEDATECODE tinyint INOUT Before or after the process date
@INCLUDEINVOICESWITHDISCOUNT bit INOUT Include invoices with discounts that expire
@DISCOUNTDATENUMBEROFDAYS int INOUT Number of days after
@DISCOUNTDATECODE tinyint INOUT Before or after the process date
@IDSETREGISTERID uniqueidentifier INOUT Selection
@CALCULATEDISCOUNTDAYS int INOUT Number of days before the process date

Definition

Copy


CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_DISBURSEMENTPROCESSTEMPLATE_TRANSACTIONCRITERIA(
  @ID uniqueidentifier,
  @DATALOADED bit = 0 output,
  @TSLONG bigint = 0 output,
    @FILTERCODE tinyint = null output,
    @DUEDATENUMBEROFDAYS integer = null output,
    @DUEDATECODE tinyint = null output,
  @INCLUDEINVOICESWITHDISCOUNT bit = null output,
  @DISCOUNTDATENUMBEROFDAYS integer = null output,
  @DISCOUNTDATECODE tinyint = null output,
  @IDSETREGISTERID uniqueidentifier = null output,
  @CALCULATEDISCOUNTDAYS integer = null output
)
as

    set nocount on;

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

    set @DATALOADED = 0
    set @TSLONG = 0

    -- populate the output parameters, which correspond to fields on the form.  Note that

    -- we set @DATALOADED = 1 to indicate that the load was successful.  Otherwise, the system

    -- will display a "no data loaded" message.  Also note that we fetch the TSLONG so that concurrency

    -- can be considered.

    select
        @DATALOADED = 1,
        @TSLONG = TSLONG,
        @FILTERCODE = FILTERCODE,
        @DUEDATENUMBEROFDAYS = DUEDATENUMBEROFDAYS,
        @DUEDATECODE = DUEDATECODE,
    @INCLUDEINVOICESWITHDISCOUNT = INCLUDEINVOICESWITHDISCOUNT,
    @DISCOUNTDATENUMBEROFDAYS = DISCOUNTDATENUMBEROFDAYS,
    @DISCOUNTDATECODE = DISCOUNTDATECODE,
    @IDSETREGISTERID = IDSETREGISTERID,
    @CALCULATEDISCOUNTDAYS = CALCULATEDISCOUNTDAYS
    from dbo.DISBURSEMENTPROCESSTEMPLATE
    where ID = @ID

    return 0;