USP_DATAFORMTEMPLATE_EDITLOAD_SURVEY
The load procedure used by the edit dataform template "Survey Edit Form"
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | The input ID parameter used to load the fields defined on the form. |
@CONSTITUENTNAME | nvarchar(700) | INOUT | CONSTITUENTNAME |
@DATALOADED | bit | INOUT | Output parameter indicating whether or not data was actually loaded. |
@NAME | nvarchar(250) | INOUT | Name |
@DATESENT | datetime | INOUT | Send date |
@DATERESPONDED | datetime | INOUT | Response date |
@SURVEYCATEGORYCODEID | uniqueidentifier | INOUT | Category |
@COMMENT | nvarchar(max) | INOUT | Comment |
@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. |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_SURVEY
(
@ID uniqueidentifier,
@CONSTITUENTNAME nvarchar(700) = null output,
@DATALOADED bit = 0 output,
@NAME nvarchar(250) = null output,
@DATESENT datetime = null output,
@DATERESPONDED datetime = null output,
@SURVEYCATEGORYCODEID uniqueidentifier = null output,
@COMMENT nvarchar(max) = null output,
@TSLONG bigint = 0 output
)
as
set nocount on;
set @DATALOADED = 0;
set @TSLONG = 0;
begin try
select
@DATALOADED = 1,
@TSLONG = SURVEY.TSLONG,
@NAME = SURVEY.NAME,
@DATESENT = SURVEY.DATESENT,
@DATERESPONDED = SURVEY.DATERESPONDED,
@SURVEYCATEGORYCODEID = SURVEY.SURVEYCATEGORYCODEID,
@COMMENT = SURVEY.COMMENT,
@CONSTITUENTNAME = NF.NAME
from dbo.SURVEY
outer apply dbo.UFN_CONSTITUENT_DISPLAYNAME(SURVEY.CONSTITUENTID) NF
where
SURVEY.ID = @ID
end try
begin catch
exec dbo.USP_RAISE_ERROR;
return 1;
end catch
return 0;