USP_DATAFORMTEMPLATE_VIEW_VENDORINFORMATION
The load procedure used by the view dataform template "Vendor Information 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. |
@CUSTOMERNUMBER | nvarchar(20) | INOUT | Customer number |
@PAYMENTTERM | nvarchar(50) | INOUT | Payment terms |
@PAYMENTMETHOD | nvarchar(5) | INOUT | Payment method |
@PAYMENTBANKACCOUNT | nvarchar(100) | INOUT | Payment bank account |
@INCLUDEIN1099 | bit | INOUT | Include in 1099 reporting |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_VENDORINFORMATION
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@CUSTOMERNUMBER nvarchar(20) = null output,
@PAYMENTTERM nvarchar(50) = null output,
@PAYMENTMETHOD nvarchar(5) = null output,
@PAYMENTBANKACCOUNT nvarchar(100) = null output,
@INCLUDEIN1099 bit = null output
)
as
set nocount on;
-- be sure to set these, 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. Also note that we fetch the TSLONG so that concurrency
-- can be considered.
select
@DATALOADED = 1,
@CUSTOMERNUMBER = V.CUSTOMERNUMBER,
@PAYMENTTERM = PT.NAME,
@PAYMENTMETHOD = V.PAYMENTMETHOD,
@INCLUDEIN1099 = V.INCLUDEIN1099,
@PAYMENTBANKACCOUNT = B.ACCOUNTNAME
from dbo.VENDOR V
left outer join PAYMENTTERM PT on PT.ID = V.PAYMENTTERMID
left outer join BANKACCOUNT B on B.ID = V.PAYMENTBANKACCOUNTID
where V.ID = @ID;
return 0;