USP_DATAFORMTEMPLATE_ADD_RESEARCHPOINTTEMPLATECOPY
The save procedure used by the add dataform template "Prospect Research Template Copy Add Form".
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@COPYID | uniqueidentifier | IN | Input parameter indicating the context ID for the record being added. |
@ID | uniqueidentifier | INOUT | The output parameter indicating the ID of the record added. |
@CHANGEAGENTID | uniqueidentifier | IN | Input parameter indicating the ID of the change agent invoking the procedure. |
@NAME | nvarchar(100) | IN | Report template name |
@DESCRIPTION | nvarchar(255) | IN | Description |
@SECTIONS | xml | IN | Selected sections |
@CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_RESEARCHPOINTTEMPLATECOPY(
@COPYID uniqueidentifier,
@ID uniqueidentifier = null output,
@CHANGEAGENTID uniqueidentifier = null,
@NAME nvarchar(100),
@DESCRIPTION nvarchar(255) = '',
@SECTIONS xml = null,
@CURRENTAPPUSERID uniqueidentifier
) as begin
set nocount on;
if @ID is null
set @ID = newid()
if @CHANGEAGENTID is null
exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output
declare @CURRENTDATE datetime = getdate();
begin try
insert into dbo.PROSPECTRESEARCHTEMPLATE (
ID,
NAME,
DESCRIPTION,
ISSYSTEM,
OWNERID,
ADDEDBYID,
CHANGEDBYID,
DATEADDED,
DATECHANGED
) values (
@ID,
@NAME,
@DESCRIPTION,
0,
@CURRENTAPPUSERID,
@CHANGEAGENTID,
@CHANGEAGENTID,
@CURRENTDATE,
@CURRENTDATE
)
exec dbo.USP_PROSPECTRESEARCHTEMPLATE_GETSECTIONS_ADDFROMXML @ID, @SECTIONS, @CHANGEAGENTID, @CURRENTDATE;
end try
begin catch
exec dbo.USP_RAISE_ERROR
return 1
end catch
return 0
end