USP_DATAFORMTEMPLATE_VIEW_BANKACCOUNTDEPOSITDETAIL

The load procedure used by the view dataform template "Bank Account Deposit Detail 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.
@ORGANIZATIONAMOUNT money INOUT Organization amount
@BASEEXCHANGERATE decimal(20, 8) INOUT Base exchange rate
@ORGANIZATIONEXCHANGERATE decimal(20, 8) INOUT Organization exchange rate

Definition

Copy


create procedure dbo.USP_DATAFORMTEMPLATE_VIEW_BANKACCOUNTDEPOSITDETAIL
(
    @ID uniqueidentifier,
    @DATALOADED bit = 0 output,
    @ORGANIZATIONAMOUNT money = null output,
    @BASEEXCHANGERATE decimal(20,8)= null output,
    @ORGANIZATIONEXCHANGERATE decimal(20,8) = null output
)
as
    set nocount on;

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

    set @DATALOADED = 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.

    select @DATALOADED = 1,
           @ORGANIZATIONAMOUNT = T.ORGANIZATIONAMOUNT,
           @BASEEXCHANGERATE = BR.RATE,
           @ORGANIZATIONEXCHANGERATE = OrgR.RATE
    from dbo.BANKACCOUNTTRANSACTION T
    left outer join dbo.CURRENCYEXCHANGERATE BR on T.BASEEXCHANGERATEID = BR.ID
    left outer join dbo.CURRENCYEXCHANGERATE OrgR on T.ORGANIZATIONEXCHANGERATEID = OrgR.ID
    where T.ID = @ID

    return 0;