USP_DATAFORMTEMPLATE_EDIT_DESIGNATION_2
The save procedure used by the edit dataform template "Designation Edit Form 2".
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | The input ID parameter indicating the ID of the record being edited. |
@CHANGEAGENTID | uniqueidentifier | IN | Input parameter indicating the ID of the change agent invoking the procedure. |
@DESIGNATIONREPORT1CODEID | uniqueidentifier | IN | Report code 1 |
@DESIGNATIONREPORT2CODEID | uniqueidentifier | IN | Report code 2 |
@USERID | nvarchar(512) | IN | Lookup ID |
@VANITYNAME | nvarchar(512) | IN | Public name |
@VSECATEGORYID | uniqueidentifier | IN | VSE category |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDIT_DESIGNATION_2
(
@ID uniqueidentifier,
@CHANGEAGENTID uniqueidentifier = null,
@DESIGNATIONREPORT1CODEID uniqueidentifier,
@DESIGNATIONREPORT2CODEID uniqueidentifier,
@USERID nvarchar(512),
@VANITYNAME nvarchar(512),
@VSECATEGORYID uniqueidentifier
)
as
set nocount on;
declare @CURRENTDATE datetime;
set @CURRENTDATE = getdate();
begin try
if @CHANGEAGENTID is null
exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output;
if @VANITYNAME is null
set @VANITYNAME = '';
if len(@VANITYNAME) = 0
raiserror('ERR_VANITYNAME_REQUIRED', 13, 1);
update
dbo.DESIGNATION
set
DESIGNATIONREPORT1CODEID = @DESIGNATIONREPORT1CODEID,
DESIGNATIONREPORT2CODEID = @DESIGNATIONREPORT2CODEID,
CHANGEDBYID = @CHANGEAGENTID,
DATECHANGED = @CURRENTDATE,
USERID = @USERID,
VANITYNAME = @VANITYNAME,
VSECATEGORYID = @VSECATEGORYID
where
ID = @ID;
end try
begin catch
exec dbo.USP_RAISE_ERROR;
return 1;
end catch
return 0;