USP_DATAFORMTEMPLATE_ADD_STEWARDSHIPPLANSTEWARD
The save procedure used by the add dataform template "Stewardship Plan Steward Add Form".
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | INOUT | The output parameter indicating the ID of the record added. |
@STEWARDSHIPPLANID | uniqueidentifier | IN | Input parameter indicating the context ID for the record being added. |
@CHANGEAGENTID | uniqueidentifier | IN | Input parameter indicating the ID of the change agent invoking the procedure. |
@CONSTITUENTID | uniqueidentifier | IN | Steward |
@ROLECODEID | uniqueidentifier | IN | Role |
@STARTDATE | date | IN | Start date |
@ENDDATE | date | IN | End date |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_STEWARDSHIPPLANSTEWARD
(
@ID uniqueidentifier = null output,
@STEWARDSHIPPLANID uniqueidentifier,
@CHANGEAGENTID uniqueidentifier = null,
@CONSTITUENTID uniqueidentifier = null,
@ROLECODEID uniqueidentifier = null,
@STARTDATE date = null,
@ENDDATE date = null
)
as
set nocount on;
declare @CURRENTDATE datetime;
begin try
if @ID is null
set @ID = newid();
if @CHANGEAGENTID is null
exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output;
set @CURRENTDATE = getdate();
insert into dbo.STEWARDSHIPPLANSTEWARD (
[ID],
[PLANID],
[CONSTITUENTID],
[ROLECODEID],
[ADDEDBYID],
[CHANGEDBYID],
[DATEADDED],
[DATECHANGED],
[STARTDATE],
[ENDDATE]
) values (
@ID,
@STEWARDSHIPPLANID,
@CONSTITUENTID,
@ROLECODEID,
@CHANGEAGENTID,
@CHANGEAGENTID,
@CURRENTDATE,
@CURRENTDATE,
@STARTDATE,
@ENDDATE
);
end try
begin catch
exec dbo.USP_RAISE_ERROR;
return 1;
end catch
return 0;