USP_DATAFORMTEMPLATE_EDITLOAD_NAMINGOPPORTUNITYRECOGNITION
The load procedure used by the edit dataform template "Naming Opportunity Recognition Edit Form"
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | The input ID parameter used to load the fields defined on the form. |
@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. |
@DATALOADED | bit | INOUT | Output parameter indicating whether or not data was actually loaded. |
@NAMINGOPPORTUNITYNAME | nvarchar(100) | INOUT | Naming opportunity |
@REMAINING | int | INOUT | Quantity available |
@CONSTITUENTID | uniqueidentifier | INOUT | Constituent |
@CONSTITUENTNAMEFORMATID | uniqueidentifier | INOUT | Name format |
@CUSTOMNAMEFORMAT | nvarchar(100) | INOUT | Custom name format |
@STARTDATE | UDT_FUZZYDATE | INOUT | Recognition date |
@ENDDATE | UDT_FUZZYDATE | INOUT | Recognition ends |
@AMOUNT | money | INOUT | Recognition amount |
@QUANTITY | int | INOUT | Quantity |
@INSCRIPTION | nvarchar(max) | INOUT | Inscription |
@SPECIALREQUEST | nvarchar(max) | INOUT | Special request |
@BASECURRENCYID | uniqueidentifier | INOUT | Base currency |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_NAMINGOPPORTUNITYRECOGNITION
(
@ID uniqueidentifier,
@TSLONG bigint = 0 output,
@DATALOADED bit = 0 output,
@NAMINGOPPORTUNITYNAME nvarchar(100) = null output,
@REMAINING int = null output,
@CONSTITUENTID uniqueidentifier = null output,
@CONSTITUENTNAMEFORMATID uniqueidentifier = null output,
@CUSTOMNAMEFORMAT nvarchar(100) = null output,
@STARTDATE dbo.UDT_FUZZYDATE = null output,
@ENDDATE dbo.UDT_FUZZYDATE = null output,
@AMOUNT money = null output,
@QUANTITY int = null output,
@INSCRIPTION nvarchar(max) = null output,
@SPECIALREQUEST nvarchar(max) = null output,
@BASECURRENCYID uniqueidentifier = null output
)
as
set nocount on;
select
@DATALOADED = 1,
@NAMINGOPPORTUNITYNAME = (select NAME from dbo.NAMINGOPPORTUNITY where ID = NAMINGOPPORTUNITYID),
@CONSTITUENTID = CONSTITUENTID,
@CONSTITUENTNAMEFORMATID = CONSTITUENTNAMEFORMATID,
@CUSTOMNAMEFORMAT = CUSTOMNAMEFORMAT,
@STARTDATE = STARTDATE,
@ENDDATE = ENDDATE,
@AMOUNT = AMOUNT,
@QUANTITY = QUANTITY,
@REMAINING = coalesce((select REMAINING from dbo.NAMINGOPPORTUNITY where ID = NAMINGOPPORTUNITYID), 0),
@INSCRIPTION = INSCRIPTION,
@SPECIALREQUEST = SPECIALREQUEST,
@TSLONG = TSLONG,
@BASECURRENCYID = BASECURRENCYID
from dbo.NAMINGOPPORTUNITYRECOGNITION
where ID = @ID;
set @REMAINING = @REMAINING + @QUANTITY;